Changes in CUPS v2.4.12 (YYYY-MM-DD)
------------------------------------
+- Fixed a compressed file error handling bug (Issue #1070)
- Fixed the default User-Agent string.
- Fixed a recursion issue in `ippReadIO`.
if (fp->stream.avail_in > 0)
{
+ /*
+ * Get the first N trailer bytes from the inflate stream...
+ */
+
if (fp->stream.avail_in > sizeof(trailer))
tbytes = (ssize_t)sizeof(trailer);
else
fp->stream.avail_in -= (size_t)tbytes;
}
+ /*
+ * Reset the compressed flag so that we re-read the file header...
+ */
+
+ inflateEnd(&fp->stream);
+
+ fp->compressed = 0;
+
+ /*
+ * Get any remaining trailer bytes...
+ */
+
if (tbytes < (ssize_t)sizeof(trailer))
{
if (read(fp->fd, trailer + tbytes, sizeof(trailer) - (size_t)tbytes) < ((ssize_t)sizeof(trailer) - tbytes))
}
}
+ /*
+ * Calculate and compare the CRC...
+ */
+
tcrc = ((uLong)trailer[3] << 24) | ((uLong)trailer[2] << 16) | ((uLong)trailer[1] << 8) | ((uLong)trailer[0]);
if (tcrc != fp->crc)
return (-1);
}
-
- /*
- * Otherwise, reset the compressed flag so that we re-read the
- * file header...
- */
-
- inflateEnd(&fp->stream);
-
- fp->compressed = 0;
}
else if (status < Z_OK)
{