diff options
author | Antony Dovgal <tony2001@php.net> | 2004-10-18 15:05:06 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2004-10-18 15:05:06 +0000 |
commit | e865bc2bc55dd5846aede8cdd9d5c2b309ee9e65 (patch) | |
tree | ec52b564e849937ff1c6a6b2ce2dd172e3987bf4 /main/php_variables.c | |
parent | d608f1a0e01caa9580aec9f55b04a59a61a1318c (diff) | |
download | php-git-e865bc2bc55dd5846aede8cdd9d5c2b309ee9e65.tar.gz |
fix bug #30442 ( segmentation fault when parsing ?getvariable[][ )
Diffstat (limited to 'main/php_variables.c')
-rw-r--r-- | main/php_variables.c | 6 |
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; } |