Skip to content

Commit d05aa65

Browse files
committed
Report error when unable to read attribute name.
Report validation errors, if any, when reading an IPP message in the unit test program.
1 parent e2d8c70 commit d05aa65

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
@@ -5609,6 +5609,7 @@ ipp_read_io(void *src, // I - Data source
56095609
// New attribute; read the name and add it...
56105610
if ((*cb)(src, buffer, (size_t)n) < n)
56115611
{
5612+
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to read IPP attribute name."), 1);
56125613
DEBUG_puts("1ipp_read_io: unable to read name.");
56135614
goto rollback;
56145615
}
@@ -5965,6 +5966,8 @@ ipp_read_io(void *src, // I - Data source
59655966
// attribute read in order to keep the IPP message valid...
59665967
rollback:
59675968

5969+
DEBUG_puts("1ipp_read_io: <<rollback>>");
5970+
59685971
_cupsBufferRelease((char *)buffer);
59695972

59705973
if (attr)

cups/testipp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ main(int argc, // I - Number of command-line arguments
866866

867867
if (request)
868868
{
869-
printf("\n%s:\n", argv[i]);
869+
printf("\n%s: %s\n", argv[i], ippValidateAttributes(request) ? "OK" : cupsGetErrorString());
870870
print_attributes(request, 4);
871871
ippDelete(request);
872872
}

0 commit comments

Comments
 (0)