Closed fish98 closed 1 week ago
[master 7a2d383ee] Make sure we call inflateEnd when there is an error reading or comparing the stream CRC (Issue #1070)
[2.4.x fe04be501] Make sure we call inflateEnd when there is an error reading or comparing the stream CRC (Issue #1070)
To reiterate my comments on the libcups issue of the same name, this isn't caused by a lack of read validation but the fact that on error we didn't call inflateEnd...
Description
Similar to the reported issue in OpenPrinting/libcups#91. The use of uninitialized memory of the trailer array is found in function
cups_fill
ofcups/file.c
. Detailed code can be found below:when
vail_in
is less thansizeof(trailer)
, the operationmemcpy(trailer, fp->stream.next_in, (size_t)tbytes);
will end up with uninitialized value intrailer
array. The subsequent functionif (read(fp->fd, trailer + tbytes, sizeof(trailer) - (size_t)tbytes) < ((ssize_t)sizeof(trailer) - tbytes))
may also inroduce unitialized value issue whenread()
function returnsEOF
or error.