]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix regressions in ippValidateAttribute (Issue #5322, Issue #5330)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 11 Jun 2018 13:37:34 +0000 (09:37 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 11 Jun 2018 13:37:38 +0000 (09:37 -0400)
CHANGES.md
cups/ipp.c

index 2e42d94dc174b2be8ab317d838cb7526a59a49e3..5b91b7029b73bf870f1b401ed570d56f97480731 100644 (file)
@@ -1,9 +1,11 @@
-CHANGES - 2.3b6 - 2018-06-05
+CHANGES - 2.3b6 - 2018-06-11
 ============================
 
 Changes in CUPS v2.3b6
 ----------------------
 
+- Fixed a regression in the changes to ippValidateAttribute (Issue #5322,
+  Issue #5330)
 - Fixed a memory leak for some IPP (extension) syntaxes.
 
 
index 95d53cc447ba2439f45182913b65c6c7ccbcaf0a..325de02b9235ee20bfbebb04f6928bf959d480e2 100644 (file)
@@ -5033,16 +5033,19 @@ ippValidateAttribute(
              break;
          }
 
-         if (*ptr < ' ' || *ptr == 0x7f)
-         {
-           ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
-           return (0);
-         }
-         else if (*ptr)
-         {
-           ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
-           return (0);
-         }
+          if (*ptr)
+          {
+           if (*ptr < ' ' || *ptr == 0x7f)
+           {
+             ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
+             return (0);
+           }
+           else
+           {
+             ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
+             return (0);
+           }
+          }
 
          if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1))
          {
@@ -5091,16 +5094,19 @@ ippValidateAttribute(
              break;
          }
 
-         if (*ptr < ' ' || *ptr == 0x7f)
-         {
-           ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
-           return (0);
-         }
-         else if (*ptr)
+         if (*ptr)
          {
-           ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
-           return (0);
-         }
+           if (*ptr < ' ' || *ptr == 0x7f)
+           {
+             ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
+             return (0);
+           }
+           else
+           {
+             ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
+             return (0);
+           }
+          }
 
          if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1))
          {