Skip to content

Commit

Permalink
Mirror fixes from libcups:
Browse files Browse the repository at this point in the history
- Allow empty resolution values in ipptool files.
- Fix memory leak in httpConnectAgain.
- Remove dead code in ipp_read_io.
  • Loading branch information
michaelrsweet committed Oct 15, 2024
1 parent dd9aa20 commit 8b6ca61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions cups/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ httpConnectAgain(http_t *http, // I - HTTP connection

return (false);
}

free(new_creds);
}

free(orig_creds);
Expand Down
2 changes: 1 addition & 1 deletion cups/ipp-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 1 addition & 7 deletions cups/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 8b6ca61

Please sign in to comment.