]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
Potential null dereference fix (#1)
authorDuratarskeyK <shadowpilot34@gmail.com>
Fri, 26 Jun 2020 12:11:38 +0000 (15:11 +0300)
committerTill Kamppeter <till.kamppeter@gmail.com>
Thu, 20 Aug 2020 19:33:53 +0000 (21:33 +0200)
Fix a potential NULL dereference, when PPD file isn't present or can't be openned

(cherry picked from commit c30dcf007ccbfe1edb21e3b1227d482a762a8a35)

filter/imagetoraster.c

index cd52de8c7a8c8825d29f2f40c75876c53d7e2fed..f5aef765163b61eb03c5c34f8b841f90ba05052f 100644 (file)
@@ -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)