Skip to content

Commit 292df3c

Browse files
committed
Check the return status of the write call when first creating a compressed file.
1 parent 38feec3 commit 292df3c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cups/file.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,11 @@ cupsFileOpenFd(int fd, // I - File descriptor
777777
header[8] = 0;
778778
header[9] = 0x03;
779779

780-
cups_write(fp, (char *)header, 10);
780+
if (!cups_write(fp, (char *)header, 10))
781+
{
782+
free(fp);
783+
return (NULL);
784+
}
781785

782786
// Initialize the compressor...
783787
if (deflateInit2(&(fp->stream), mode[1] - '0', Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY) < Z_OK)

0 commit comments

Comments
 (0)