cvs: ZendEngine2(PHP_5_1) / zend_builtin_functions.c php-src NEWS
| From: | Antony Dovgal | Date: | Wed, 05 Apr 2006 11:36:13 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_1) / zend_builtin_functions.c php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4789@lists.php.net to get a copy of this message | ||
tony2001 Wed Apr 5 11:36:13 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src NEWS
/ZendEngine2 zend_builtin_functions.c
Log:
fix #36944 (strncmp & strncasecmp do not return false on negative string length)
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.492&r2=1.2027.2.493&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.492 php-src/NEWS:1.2027.2.493
--- php-src/NEWS:1.2027.2.492 Wed Apr 5 02:28:06 2006
+++ php-src/NEWS Wed Apr 5 11:36:13 2006
@@ -14,6 +14,8 @@
- Fixed debug_zval_dump() to support private and protected members. (Dmitry)
- Fixed SoapFault::getMessage(). (Dmitry)
- Fixed bug #36957 (serialize() does not handle recursion). (Ilia)
+- Fixed bug #36944 (strncmp & strncasecmp do not return false on negative
+ string length). (Tony)
- Fixed bug #36941 (ArrayIterator does not clone itself). (Marcus)
- Fixed bug #36898 (__set() leaks in classes extending internal ones).
(Tony, Dmitry)
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.277.2.11&r2=1.277.2.12&diff_format=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.277.2.11
ZendEngine2/zend_builtin_functions.c:1.277.2.12
--- ZendEngine2/zend_builtin_functions.c:1.277.2.11 Tue Mar 28 19:43:21 2006
+++ ZendEngine2/zend_builtin_functions.c Wed Apr 5 11:36:13 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.c,v 1.277.2.11 2006/03/28 19:43:21 tony2001 Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.277.2.12 2006/04/05 11:36:13 tony2001 Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -314,6 +314,12 @@
convert_to_string_ex(s1);
convert_to_string_ex(s2);
convert_to_long_ex(s3);
+
+ if (Z_LVAL_PP(s3) < 0) {
+ zend_error(E_WARNING, "Length must be greater than or equal to 0");
+ RETURN_FALSE;
+ }
+
RETURN_LONG(zend_binary_zval_strncmp(*s1, *s2, *s3));
}
/* }}} */
@@ -347,6 +353,12 @@
convert_to_string_ex(s1);
convert_to_string_ex(s2);
convert_to_long_ex(s3);
+
+ if (Z_LVAL_PP(s3) < 0) {
+ zend_error(E_WARNING, "Length must be greater than or equal to 0");
+ RETURN_FALSE;
+ }
+
RETURN_LONG(zend_binary_zval_strncasecmp(*s1, *s2, *s3));
}
/* }}} */