|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2015-01-02 08:53 UTC] bugreports at internot dot info
 Description:
------------
Hi,
In /ext/zlib/zlib.c:
If this is true:
367                if ((max && (max <= buffer.used)) || !(buffer.aptr = erealloc_recoverable(buffer.data, buffer.size))) {
368                        status = Z_MEM_ERROR;
then this will execute:
393                if (buffer.data) {
394                        efree(buffer.data);
395                }
That if(buffer.data) statement will do nothing. It will always evaluate to NULL.
Thanks,
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 06:00:01 2025 UTC | 
So apparently I sent this without enough sleep. I assumed erealloc_recoverable() freed buffer.data. But anyways, if not, there's a non-security related bug The test here: 393 if (buffer.data) { 394 efree(buffer.data); 395 } is useless. even if buffer.data = NULL, it should be freed, no? Just as long as buffer.data has allocated memory, it shouldn't be. Thanks,