-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server hang using a malformed gzip file #4602
Comments
CUPS.org User: mike Update: have been investigating since Friday and have a tentative patch I am testing now... |
CUPS.org User: mike OK, patch attached which fixes this issue as well as a bug in the gzip CRC checking code. Holding full disclosure until release... |
CUPS.org User: mike Fixed in Subversion repository. |
"str4602.patch": Index: cups/file.c--- cups/file.c (revision 12567)
if (!fp || (fp->mode != 'r' && fp->mode != 's'))
if (fp->ptr >= fp->end)
if (fp->ptr >= fp->end)
/*
@@ -2234,6 +2240,11 @@
@@ -2246,6 +2257,11 @@
fp->stream.next_in = fp->cbuf; unsigned char trailer[8]; /* Trailer bytes /
- (uLong)trailer[1]) << 8) | (uLong)trailer[0];
- fp->end = fp->buf + bytes;return (bytes); Index: cups/testfile.c--- cups/testfile.c (revision 12567)
if ((fp = cupsFileOpen(argv[1], "r")) == NULL)
@@ -224,6 +224,21 @@
return (status);
/*
/*
|
Version: 2.0-current
CUPS.org User: pdewacht
The CUPS server can get stuck in an infinite loop when a user queues a malformed gzip file. When this happens the CUPS server will be unable to service any further requests. (I'm running CUPS using systemd's socket activation, which might perhaps be relevant.)
To reproduce: lp < gziphang.dat
Note: it's important to feed the file via stdin, otherwise it's the client that gets stuck (client and server use the same code).
Found by running afl-fuzz against the 'testmime' program.
The text was updated successfully, but these errors were encountered: