iliaa           Thu Mar  8 00:18:11 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       string.c 
  Log:
  Improved length parameter validation
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.47&r2=1.445.2.14.2.48&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.47 
php-src/ext/standard/string.c:1.445.2.14.2.48
--- php-src/ext/standard/string.c:1.445.2.14.2.47       Thu Mar  8 00:06:41 2007
+++ php-src/ext/standard/string.c       Thu Mar  8 00:18:10 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.47 2007/03/08 00:06:41 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.48 2007/03/08 00:18:10 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -4655,7 +4655,7 @@
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Length should be greater than 0.");
                                RETURN_FALSE;           
                        }
-                       if ((p + Z_LVAL_PP(length)) > endp) {
+                       if ((p + Z_LVAL_PP(length)) <= p || (p + 
Z_LVAL_PP(length)) > endp) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Length value %ld exceeds string length.", Z_LVAL_PP(length));
                                RETURN_FALSE;
                        }

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

Reply via email to