tony2001 Mon Oct 18 11:07:06 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src/main php_variables.c
Log:
MFH: fix bug #30442 ( segmentation fault when parsing ?getvariable[][ )
http://cvs.php.net/diff.php/php-src/main/php_variables.c?r1=1.81.2.1&r2=1.81.2.2&ty=u
Index: php-src/main/php_variables.c
diff -u php-src/main/php_variables.c:1.81.2.1 php-src/main/php_variables.c:1.81.2.2
--- php-src/main/php_variables.c:1.81.2.1 Thu Sep 9 12:21:49 2004
+++ php-src/main/php_variables.c Mon Oct 18 11:07:06 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.c,v 1.81.2.1 2004/09/09 16:21:49 rasmus Exp $ */
+/* $Id: php_variables.c,v 1.81.2.2 2004/10/18 15:07:06 tony2001 Exp $ */
#include <stdio.h>
#include "php.h"
@@ -133,7 +133,11 @@
if (!ip) {
/* PHP variables cannot contain '[' in their
names, so we replace the character with a '_' */
*(index_s - 1) = '_';
- index_len = var_len = strlen(index);
+
+ index_len = var_len = 0;
+ if (index) {
+ index_len = var_len = strlen(index);
+ }
goto plain_var;
return;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php