mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
fix a segfault when passing an empty value to a ini parameter from the web server (php_(admin_)?value)
This commit is contained in:
parent
3c323a5d6d
commit
251879c890
@ -1327,22 +1327,28 @@ static void init_request_info(TSRMLS_D)
|
|||||||
static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */
|
static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */
|
||||||
{
|
{
|
||||||
int *mode = (int *)arg;
|
int *mode = (int *)arg;
|
||||||
char *key = Z_STRVAL_P(arg1);
|
char *key;
|
||||||
char *value = Z_STRVAL_P(arg2);
|
char *value = NULL;
|
||||||
struct key_value_s kv;
|
struct key_value_s kv;
|
||||||
|
|
||||||
if (!mode) return;
|
if (!mode || !arg1) return;
|
||||||
|
|
||||||
if (callback_type != ZEND_INI_PARSER_ENTRY) {
|
if (callback_type != ZEND_INI_PARSER_ENTRY) {
|
||||||
zlog(ZLOG_ERROR, "Passing INI directive through FastCGI: only classic entries are allowed");
|
zlog(ZLOG_ERROR, "Passing INI directive through FastCGI: only classic entries are allowed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
key = Z_STRVAL_P(arg1);
|
||||||
|
|
||||||
if (!key || strlen(key) < 1) {
|
if (!key || strlen(key) < 1) {
|
||||||
zlog(ZLOG_ERROR, "Passing INI directive through FastCGI: empty key");
|
zlog(ZLOG_ERROR, "Passing INI directive through FastCGI: empty key");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arg2) {
|
||||||
|
value = Z_STRVAL_P(arg2);
|
||||||
|
}
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
zlog(ZLOG_ERROR, "Passing INI directive through FastCGI: empty value for key '%s'", key);
|
zlog(ZLOG_ERROR, "Passing INI directive through FastCGI: empty value for key '%s'", key);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user