Fix bug #76524 - ZipArchive memory leak#3325
Conversation
|
PHP 5.6 (and 7.0) only accept security fixes now, so the lowest this fix can target is PHP 7.1. Also, could you provide some more information on your setup where you can trigger the heap corruption problems (PHP version and whether ZTS mode is enabled)? |
@tpunt, PHP 5.6.36, ZTS disabled.
@krakjoe, sorry, could you explain why is this fix wrong? |
|
Scratch that, my morning brain read the patch the wrong way round, though it was adding the early return, not removing it ... Mondays 😄 |
Sorry, I just doubted about status of memory leak bugs. |
|
@timurib Do you receive heap corruption issues on PHP 7.1 and higher? |
|
@tpunt, unfortunately, I cannot check it: the legacy project, where corruption occurs, is huge and very old, and it's just cannot run on PHP 7. I couldn't find a minimal example to reproduce the crash, but everything works well with workaround to avoid this leak (I replaced the |
The memory leak occurs when
ZipArchiveis opened withZipArchive::CREATE|ZipArchive::OVERWRITEflags,close()method call.The leak does not occur if the zip file already exist. All newer versions are affected too.
Also, it somehow causes a
zend_mm_heapcorruptions. Unfortunately, I cannot reproduce this on development environment, but my production constantly was crashing until I found the workaround for this bug :)