]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ppd.c
Merge changes from CUPS 1.5svn-r8916.
[thirdparty/cups.git] / cups / ppd.c
index 2da53d5c001d6e7ce552fd7f0a5f7a624cd7192b..6fe2dc7768ec454c3392e07d32e08095e7478d7d 100644 (file)
@@ -352,11 +352,13 @@ ppdErrorString(ppd_status_t status)       /* I - PPD status */
                  _("Illegal option keyword string"),
                  _("Illegal translation string"),
                  _("Illegal whitespace character"),
-                 _("Bad custom parameter")
+                 _("Bad custom parameter"),
+                 _("Missing option keyword"),
+                 _("Bad value string")
                };
 
 
-  if (status < PPD_OK || status > PPD_ILLEGAL_WHITESPACE)
+  if (status < PPD_OK || status >= PPD_MAX_STATUS)
     return (_cupsLangString(cupsLangDefault(), _("Unknown")));
   else
     return (_cupsLangString(cupsLangDefault(), messages[status]));
@@ -1177,6 +1179,37 @@ ppdOpen2(cups_file_t *fp)                /* I - File to read from */
     }
     else if (!strcmp(keyword, "JobPatchFile"))
     {
+     /*
+      * CUPS STR #3421: Check for "*JobPatchFile: int: string"
+      */
+
+      if (isdigit(*string & 255))
+      {
+        for (sptr = string + 1; isdigit(*sptr & 255); sptr ++);
+
+        if (*sptr == ':')
+        {
+         /*
+          * Found "*JobPatchFile: int: string"...
+          */
+
+          cg->ppd_status = PPD_BAD_VALUE;
+
+         goto error;
+        }
+      }
+
+      if (!name[0])
+      {
+       /*
+        * Found "*JobPatchFile: string"...
+        */
+
+        cg->ppd_status = PPD_MISSING_OPTION_KEYWORD;
+
+       goto error;
+      }
+
       if (ppd->patches == NULL)
         ppd->patches = strdup(string);
       else