Handle NULL strings in sapi_cli_server_register_variable().

Fixes bug #68745 (Invalid HTTP requests make web server segfault).
This commit is contained in:
Adam Harvey 2015-01-06 01:23:27 +00:00
parent 0cc2810498
commit 448ef30f75
3 changed files with 42 additions and 0 deletions

View file

@ -708,6 +708,11 @@ static void sapi_cli_server_register_variable(zval *track_vars_array, const char
{
char *new_val = (char *)val;
uint new_val_len;
if (NULL == val) {
return;
}
if (sapi_module.input_filter(PARSE_SERVER, (char*)key, &new_val, strlen(val), &new_val_len TSRMLS_CC)) {
php_register_variable_safe((char *)key, new_val, new_val_len, track_vars_array TSRMLS_CC);
}