]> granicus.if.org Git - php/commitdiff
improve check for overflow
authorAntony Dovgal <tony2001@php.net>
Mon, 25 Dec 2006 20:03:20 +0000 (20:03 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 25 Dec 2006 20:03:20 +0000 (20:03 +0000)
ext/bz2/bz2.c

index efd7af37a3127db04bcdb117dec1e3b5137f6278..b2da9832f3ba3c142483e3723b8bec5b28062ed5 100644 (file)
@@ -330,7 +330,7 @@ static PHP_FUNCTION(bzread)
        
        php_stream_from_zval(stream, &bz);
 
-       if (len < 0) {
+       if ((len + 1) < 1) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative");
                RETURN_FALSE;
        }