cvs: php-src /ext/gmp gmp.c
| From: | Antony Dovgal | Date: | Wed, 18 Apr 2007 20:53:21 +0000 |
| Subject: | cvs: php-src /ext/gmp gmp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-43977@lists.php.net to get a copy of this message | ||
tony2001 Wed Apr 18 20:53:21 2007 UTC
Modified files:
/php-src/ext/gmp gmp.c
Log:
same for gmp_scan*()
http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/gmp.c?r1=1.60&r2=1.61&diff_format=u
Index: php-src/ext/gmp/gmp.c
diff -u php-src/ext/gmp/gmp.c:1.60 php-src/ext/gmp/gmp.c:1.61
--- php-src/ext/gmp/gmp.c:1.60 Wed Apr 18 20:36:47 2007
+++ php-src/ext/gmp/gmp.c Wed Apr 18 20:53:21 2007
@@ -1580,6 +1580,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)));
}
/* }}} */
@@ -1597,6 +1602,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)));
}