]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror fixes from libcups:
authorMichael R Sweet <msweet@msweet.org>
Tue, 15 Oct 2024 15:27:48 +0000 (11:27 -0400)
committerMichael R Sweet <msweet@msweet.org>
Tue, 15 Oct 2024 15:27:48 +0000 (11:27 -0400)
- Allow empty resolution values in ipptool files.
- Fix memory leak in httpConnectAgain.
- Remove dead code in ipp_read_io.

cups/http.c
cups/ipp-file.c
cups/ipp.c

index 140dcff956aed7c0d2ca4325d3fe313aba18c108..ded6ff234020943ca8685eb6b0f7ccb64f902c81 100644 (file)
@@ -558,6 +558,8 @@ httpConnectAgain(http_t *http,              // I - HTTP connection
 
       return (false);
     }
+
+    free(new_creds);
   }
 
   free(orig_creds);
index d8f3b4ee01cff39a5b77bd7c706de0534ef2502f..0a6e61430c82c66b344b770f117df14a28b060ee 100644 (file)
@@ -1706,7 +1706,7 @@ parse_value(ipp_file_t      *file,        // I  - IPP data file
              yres = (int)strtol(ptr + 1, (char **)&ptr, 10);
          }
 
-         if (ptr <= value || xres <= 0 || yres <= 0 || !ptr || (_cups_strcasecmp(ptr, "dpi") && _cups_strcasecmp(ptr, "dpc") && _cups_strcasecmp(ptr, "dpcm") && _cups_strcasecmp(ptr, "other")))
+         if (*value && (ptr <= value || xres <= 0 || yres <= 0 || !ptr || (_cups_strcasecmp(ptr, "dpi") && _cups_strcasecmp(ptr, "dpc") && _cups_strcasecmp(ptr, "dpcm") && _cups_strcasecmp(ptr, "other"))))
          {
            report_error(file, "Bad resolution value \"%s\" on line %d of '%s'.", value, file->linenum, file->filename);
            return (false);
index 52621b1f5edd337f4a8ac577aee3510a63554f32..7cb6910471696a3bf294a0e7bd204d38cc8f3fc7 100644 (file)
@@ -5863,13 +5863,7 @@ ipp_read_io(void        *src,            // I - Data source
             case IPP_TAG_MEMBERNAME :
                // The value the name of the member in the collection, which
                // we need to carry over...
-                if (!attr)
-                {
-                 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP memberName with no attribute."), 1);
-                 DEBUG_puts("1ipp_read_io: Member name without attribute.");
-                 goto rollback;
-                }
-               else if (n == 0)
+                if (n == 0)
                {
                  _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP memberName value is empty."), 1);
                  DEBUG_puts("1ipp_read_io: Empty member name value.");