cvs: php-src(PHP_5_2) /ext/gmp gmp.c

From: Date: Wed, 18 Apr 2007 20:53:28 +0000
Subject: cvs: php-src(PHP_5_2) /ext/gmp gmp.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-43978@lists.php.net to get a copy of this message
tony2001 Wed Apr 18 20:53:28 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/gmp gmp.c Log: MFH http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/gmp.c?r1=1.49.2.2.2.9&r2=1.49.2.2.2.10&diff_format=u Index: php-src/ext/gmp/gmp.c diff -u php-src/ext/gmp/gmp.c:1.49.2.2.2.9 php-src/ext/gmp/gmp.c:1.49.2.2.2.10 --- php-src/ext/gmp/gmp.c:1.49.2.2.2.9 Wed Apr 18 20:36:54 2007 +++ php-src/ext/gmp/gmp.c Wed Apr 18 20:53:28 2007 @@ -1572,6 +1572,11 @@ FETCH_GMP_ZVAL(gmpnum_a, a_arg); convert_to_long_ex(start_arg); + if (Z_LVAL_PP(start_arg) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Starting index must be greater than or equal to zero"); + RETURN_FALSE; + } + RETURN_LONG(mpz_scan0(*gmpnum_a, Z_LVAL_PP(start_arg))); } /* }}} */ @@ -1589,6 +1594,11 @@ FETCH_GMP_ZVAL(gmpnum_a, a_arg); convert_to_long_ex(start_arg); + + if (Z_LVAL_PP(start_arg) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Starting index must be greater than or equal to zero"); + RETURN_FALSE; + } RETURN_LONG(mpz_scan1(*gmpnum_a, Z_LVAL_PP(start_arg))); }

« previous php.cvs (#43978) next »