Skip to content

Commit e15e3b4

Browse files
committed
Set error when unable to read attribute name, show validation errors in unit test.
1 parent b0b10ba commit e15e3b4

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

cups/ipp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5479,6 +5479,7 @@ ipp_read_io(void *src, // I - Data source
54795479
// New attribute; read the name and add it...
54805480
if ((*cb)(src, buffer, (size_t)n) < n)
54815481
{
5482+
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to read IPP attribute name."), true);
54825483
DEBUG_puts("1ipp_read_io: unable to read name.");
54835484
goto rollback;
54845485
}
@@ -5835,6 +5836,8 @@ ipp_read_io(void *src, // I - Data source
58355836
// attribute read in order to keep the IPP message valid...
58365837
rollback:
58375838

5839+
DEBUG_puts("1ipp_read_io: <<rollback>>");
5840+
58385841
_cupsBufferRelease((char *)buffer);
58395842

58405843
if (attr)

cups/testipp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ main(int argc, // I - Number of command-line arguments
840840
if (request)
841841
{
842842
// Print message to stdout...
843-
printf("\n%s:\n", argv[i]);
843+
printf("\n%s: %s\n", argv[i], ippValidateAttributes(request) ? "OK" : cupsGetErrorString());
844844
print_attributes(request, 4);
845845

846846
// Write to FILENAME.out

0 commit comments

Comments
 (0)