cvs: php-src(PHP_5_2) /ext/zlib zlib.c
| From: | Antony Dovgal | Date: | Mon, 26 Jun 2006 22:53:10 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/zlib zlib.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-38929@lists.php.net to get a copy of this message | ||
tony2001 Mon Jun 26 22:53:10 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/zlib zlib.c
Log:
don't try to inflate empty strings (and stop segfaulting!)
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib.c?r1=1.183.2.6.2.1&r2=1.183.2.6.2.2&diff_format=u
Index: php-src/ext/zlib/zlib.c
diff -u php-src/ext/zlib/zlib.c:1.183.2.6.2.1 php-src/ext/zlib/zlib.c:1.183.2.6.2.2
--- php-src/ext/zlib/zlib.c:1.183.2.6.2.1 Thu Jun 15 18:33:09 2006
+++ php-src/ext/zlib/zlib.c Mon Jun 26 22:53:10 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zlib.c,v 1.183.2.6.2.1 2006/06/15 18:33:09 dmitry Exp $ */
+/* $Id: zlib.c,v 1.183.2.6.2.2 2006/06/26 22:53:10 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -531,6 +531,10 @@
return;
}
+ if (!data_len) {
+ RETURN_FALSE;
+ }
+
if (limit < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal
zero", limit);
RETURN_FALSE;