_("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]));
}
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