summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2004-10-18 15:07:06 +0000
committerAntony Dovgal <tony2001@php.net>2004-10-18 15:07:06 +0000
commit750646d8225f55c24389c869478a72ce840c564f (patch)
treee653803762a7111622c0b13c61cf40047bed19c2 /main/php_variables.c
parent3f4cf40c45078a98874793864a4fd6dbd0ff19ba (diff)
downloadphp-git-750646d8225f55c24389c869478a72ce840c564f.tar.gz
MFH: fix bug #30442 ( segmentation fault when parsing ?getvariable[][ )
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index 5edfcd9206..84d341492e 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -133,7 +133,11 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_arra
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;
}