cellog          Mon Feb  9 03:44:59 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/ext/bz2    bz2_filter.c 
  Log:
  MFB fix Bug #46026 (this is a refinement of the previous fix)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1411&r2=1.2027.2.547.2.1412&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1411 php-src/NEWS:1.2027.2.547.2.1412
--- php-src/NEWS:1.2027.2.547.2.1411    Fri Feb  6 10:42:54 2009
+++ php-src/NEWS        Mon Feb  9 03:44:58 2009
@@ -2,6 +2,8 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Feb 2009, PHP 5.2.9
 - Fixed bug #47322 (sscanf %d doesn't work). (Felipe)
+- Fixed bug #46026 (bz2.decompress/zlib.inflate filter tries to decompress 
after
+  end of stream). (Greg)
 
 02 Feb 2009, PHP 5.2.9RC1
 - Changed __call() to be invoked on private/protected method access, similar to
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.3.2.2.2.11&r2=1.3.2.2.2.12&diff_format=u
Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.11 
php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.12
--- php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.11   Wed Dec 31 11:17:35 2008
+++ php-src/ext/bz2/bz2_filter.c        Mon Feb  9 03:44:59 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: bz2_filter.c,v 1.3.2.2.2.11 2008/12/31 11:17:35 sebastian Exp $ */
+/* $Id: bz2_filter.c,v 1.3.2.2.2.12 2009/02/09 03:44:59 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -332,10 +332,13 @@
                        }
 
                        if (tmpzval) {
-                               SEPARATE_ZVAL(tmpzval);
-                               convert_to_boolean_ex(tmpzval);
-                               smallFootprint = Z_LVAL_PP(tmpzval);
-                               zval_ptr_dtor(tmpzval);
+                               zval tmp, *tmp2;
+
+                               tmp = **tmpzval;
+                               zval_copy_ctor(&tmp);
+                               tmp2 = &tmp;
+                               convert_to_boolean_ex(&tmp2);
+                               smallFootprint = Z_LVAL(tmp);
                        }
                }
 
@@ -352,26 +355,31 @@
                        if (Z_TYPE_P(filterparams) == IS_ARRAY || 
Z_TYPE_P(filterparams) == IS_OBJECT) {
                                if (zend_hash_find(HASH_OF(filterparams), 
"blocks", sizeof("blocks"), (void**) &tmpzval) == SUCCESS) {
                                        /* How much memory to allocate (1 - 9) 
x 100kb */
-                                       SEPARATE_ZVAL(tmpzval);
-                                       convert_to_long_ex(tmpzval);
-                                       if (Z_LVAL_PP(tmpzval) < 1 || 
Z_LVAL_PP(tmpzval) > 9) {
+                                       zval tmp;
+       
+                                       tmp = **tmpzval;
+                                       zval_copy_ctor(&tmp);
+                                       convert_to_long(&tmp);
+                                       if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > 9) 
{
                                                php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to 
allocate. (%ld)", Z_LVAL_PP(tmpzval));
                                        } else {
-                                               blockSize100k = 
Z_LVAL_PP(tmpzval);
+                                               blockSize100k = Z_LVAL(tmp);
                                        }
-                                       zval_ptr_dtor(tmpzval);
                                }
 
                                if (zend_hash_find(HASH_OF(filterparams), 
"work", sizeof("work"), (void**) &tmpzval) == SUCCESS) {
                                        /* Work Factor (0 - 250) */
-                                       SEPARATE_ZVAL(tmpzval);
-                                       convert_to_long_ex(tmpzval);
-                                       if (Z_LVAL_PP(tmpzval) < 0 || 
Z_LVAL_PP(tmpzval) > 250) {
-                                               php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", 
Z_LVAL_PP(tmpzval));
+                                       zval tmp;
+       
+                                       tmp = **tmpzval;
+                                       zval_copy_ctor(&tmp);
+                                       convert_to_long(&tmp);
+
+                                       if (Z_LVAL(tmp) < 0 || Z_LVAL(tmp) > 
250) {
+                                               php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", 
Z_LVAL(tmp));
                                        } else {
-                                               workFactor = Z_LVAL_PP(tmpzval);
+                                               workFactor = Z_LVAL(tmp);
                                        }
-                                       zval_ptr_dtor(tmpzval);
                                }
                        }
                }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to