]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Ignore bogus cups-version attribute.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 18 Jun 2018 18:33:29 +0000 (14:33 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 18 Jun 2018 18:33:29 +0000 (14:33 -0400)
backend/ipp.c

index a0c386540d3ceb961cd3ebfdc7618d3f4cc04a74..8e9438d55c1fad54df513ed51dd6ef0fa342a9e6 100644 (file)
@@ -1135,7 +1135,14 @@ main(int  argc,                          /* I - Number of command-line args */
        copies_sup = NULL; /* No */
     }
 
-    cups_version = ippFindAttribute(supported, "cups-version", IPP_TAG_TEXT);
+    if ((cups_version = ippFindAttribute(supported, "cups-version", IPP_TAG_TEXT)) != NULL)
+    {
+      const char *version = ippGetString(cups_version, 0, NULL);
+
+      fprintf(stderr, "DEBUG: cups-version = \"%s\"\n", version);
+      if (!strcmp(version, "cups-version"))
+        cups_version = NULL;           /* Bogus cups-version value returned by buggy printers! */
+    }
 
     encryption_sup = ippFindAttribute(supported, "job-password-encryption-supported", IPP_TAG_KEYWORD);