]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
Potential null dereference fix (#1) 256/head
authorDuratarskeyK <shadowpilot34@gmail.com>
Fri, 26 Jun 2020 12:11:38 +0000 (15:11 +0300)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2020 12:11:38 +0000 (15:11 +0300)
Fix a potential NULL dereference, when PPD file isn't present or can't be openned

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)