tony2001 Mon Oct 18 11:08:46 2004 EDT
Modified files: (Branch: PHP_4_3)
/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.45.2.7&r2=1.45.2.8&ty=u
Index: php-src/main/php_variables.c
diff -u php-src/main/php_variables.c:1.45.2.7 php-src/main/php_variables.c:1.45.2.8
--- php-src/main/php_variables.c:1.45.2.7 Thu Sep 9 12:07:53 2004
+++ php-src/main/php_variables.c Mon Oct 18 11:08:46 2004
@@ -16,7 +16,7 @@
| Zeev Suraski <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.c,v 1.45.2.7 2004/09/09 16:07:53 rasmus Exp $ */
+/* $Id: php_variables.c,v 1.45.2.8 2004/10/18 15:08:46 tony2001 Exp $ */
#include <stdio.h>
#include "php.h"
@@ -129,7 +129,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