diff options
| author | Antony Dovgal <tony2001@php.net> | 2007-03-06 19:59:13 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2007-03-06 19:59:13 +0000 |
| commit | fdae6875eac570a506ad0899d7a709177c2db2e5 (patch) | |
| tree | 84ce251fe7615ca1833342d0968ccc515cc51a22 /ext/standard/basic_functions.c | |
| parent | 4f370ac55f5dde4d75a00b621164ac76f83c1dc3 (diff) | |
| download | php-git-fdae6875eac570a506ad0899d7a709177c2db2e5.tar.gz | |
fix segfault in import_request_variables() and its test
I'm not completely sure it's correct to import numeric vars like _POST["1"] etc.
Diffstat (limited to 'ext/standard/basic_functions.c')
| -rw-r--r-- | ext/standard/basic_functions.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 36b84f9d7e..582cf38cb6 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -6363,9 +6363,15 @@ PHP_FUNCTION(import_request_variables) return; } - convert_to_text(prefix); - if (Z_UNILEN_P(prefix) == 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No prefix specified - possible security hazard"); + if (ZEND_NUM_ARGS() > 1) { + convert_to_text(prefix); + + if (Z_UNILEN_P(prefix) == 0) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No prefix specified - possible security hazard"); + } + } else { + MAKE_STD_ZVAL(prefix); + ZVAL_EMPTY_TEXT(prefix); } for (p = types; p && *p; p++) { @@ -6388,6 +6394,10 @@ PHP_FUNCTION(import_request_variables) break; } } + + if (ZEND_NUM_ARGS() < 2) { + zval_ptr_dtor(&prefix); + } } /* }}} */ |
