]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Report error when unable to read attribute name.
authorMichael R Sweet <msweet@msweet.org>
Tue, 2 Sep 2025 23:46:02 +0000 (19:46 -0400)
committerMichael R Sweet <msweet@msweet.org>
Tue, 9 Sep 2025 15:18:51 +0000 (11:18 -0400)
Report validation errors, if any, when reading an IPP message in the unit test
program.

cups/ipp.c
cups/testipp.c

index 04673d6f06fbae0b340fba52a00b83de7185c8bb..2633e4d4f6314bd748ed71a98769d1aaacd063dc 100644 (file)
@@ -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: <<rollback>>");
+
   _cupsBufferRelease((char *)buffer);
 
   if (attr)
index 7ca6ea2c6a857bd2a99ee446a8d62ba3d4d3c29b..01db42bf5ea34c096b262ed559a66aa65c4154f0 100644 (file)
@@ -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);
       }