From: Michael R Sweet Date: Tue, 2 Sep 2025 23:46:02 +0000 (-0400) Subject: Report error when unable to read attribute name. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d05aa65ea9c1a1bdff9acb475f570842a625de6a;p=thirdparty%2Fcups.git Report error when unable to read attribute name. Report validation errors, if any, when reading an IPP message in the unit test program. --- diff --git a/cups/ipp.c b/cups/ipp.c index 04673d6f06..2633e4d4f6 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -5609,6 +5609,7 @@ ipp_read_io(void *src, // I - Data source // New attribute; read the name and add it... if ((*cb)(src, buffer, (size_t)n) < n) { + _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to read IPP attribute name."), 1); DEBUG_puts("1ipp_read_io: unable to read name."); goto rollback; } @@ -5965,6 +5966,8 @@ ipp_read_io(void *src, // I - Data source // attribute read in order to keep the IPP message valid... rollback: + DEBUG_puts("1ipp_read_io: <>"); + _cupsBufferRelease((char *)buffer); if (attr) diff --git a/cups/testipp.c b/cups/testipp.c index 7ca6ea2c6a..01db42bf5e 100644 --- a/cups/testipp.c +++ b/cups/testipp.c @@ -866,7 +866,7 @@ main(int argc, // I - Number of command-line arguments if (request) { - printf("\n%s:\n", argv[i]); + printf("\n%s: %s\n", argv[i], ippValidateAttributes(request) ? "OK" : cupsGetErrorString()); print_attributes(request, 4); ippDelete(request); }