From c30dcf007ccbfe1edb21e3b1227d482a762a8a35 Mon Sep 17 00:00:00 2001 From: DuratarskeyK Date: Fri, 26 Jun 2020 15:11:38 +0300 Subject: [PATCH] Potential null dereference fix (#1) Fix a potential NULL dereference, when PPD file isn't present or can't be openned --- filter/imagetoraster.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filter/imagetoraster.c b/filter/imagetoraster.c index cd52de8c7..f5aef7651 100644 --- a/filter/imagetoraster.c +++ b/filter/imagetoraster.c @@ -618,8 +618,8 @@ main(int argc, /* I - Number of command-line arguments */ int fidelity = 0; int document_large = 0; - if(ppd->custom_margins[0]||ppd->custom_margins[1] - ||ppd->custom_margins[2]||ppd->custom_margins[3]) + if(ppd != NULL && (ppd->custom_margins[0]||ppd->custom_margins[1] + ||ppd->custom_margins[2]||ppd->custom_margins[3])) margin_defined = 1; if(PageLength!=PageTop-PageBottom||PageWidth!=PageRight-PageLeft) -- 2.47.2