Fail when unsupported flags are set

This commit is contained in:
Trustin Lee 2009-10-21 11:48:43 +00:00
parent df216c2b67
commit 6505a4e285

View File

@ -404,6 +404,13 @@ final class Inflate {
z.avail_in --;
z.total_in ++;
gzipFlag = z.next_in[z.next_in_index ++] & 0xff;
if ((gzipFlag & 0xE2) != 0) {
z.istate.mode = BAD;
z.msg = "unsupported flag";
z.istate.marker = 5; // can't try inflateSync
break;
}
gzipBytesToRead = 6;
z.istate.mode = GZIP_MTIME_XFL_OS;
case GZIP_MTIME_XFL_OS: