summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-06-26 22:53:10 +0000
committerAntony Dovgal <tony2001@php.net>2006-06-26 22:53:10 +0000
commit3d97f45bc43ff0a9c6e40a4f08f5283866fa6a92 (patch)
tree76aea03cc54e3de5fadc28667d89892207dd2b50
parentfd1679e7f0645e7bc2c944450f997bd962dcb3a7 (diff)
downloadphp-git-3d97f45bc43ff0a9c6e40a4f08f5283866fa6a92.tar.gz
don't try to inflate empty strings (and stop segfaulting!)
-rw-r--r--ext/zlib/zlib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index d50dcf148b..d3932f41ad 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -531,6 +531,10 @@ PHP_FUNCTION(gzinflate)
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;