mirror of
https://github.com/php/php-src.git
synced 2024-09-26 20:37:29 +00:00
MFB: fix memleaks on zip corruption
This commit is contained in:
parent
6a6e94c0d9
commit
4eed2d8ffc
@ -480,11 +480,13 @@ foundit:
|
||||
php_stream_seek(fp, PHAR_GET_32(zipentry.offset), SEEK_SET);
|
||||
|
||||
if (sizeof(local) != php_stream_read(fp, (char *) &local, sizeof(local))) {
|
||||
pefree(entry.filename, entry.is_persistent);
|
||||
PHAR_ZIP_FAIL("phar error: internal corruption of zip-based phar (cannot read local file header for alias)");
|
||||
}
|
||||
|
||||
/* verify local header */
|
||||
if (entry.filename_len != PHAR_GET_16(local.filename_len) || entry.crc32 != PHAR_GET_32(local.crc32) || entry.uncompressed_filesize != PHAR_GET_32(local.uncompsize) || entry.compressed_filesize != PHAR_GET_32(local.compsize)) {
|
||||
pefree(entry.filename, entry.is_persistent);
|
||||
PHAR_ZIP_FAIL("phar error: internal corruption of zip-based phar (local head of alias does not match central directory)");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user