diff options
author | Xinchen Hui <laruence@php.net> | 2011-09-21 16:00:09 +0000 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2011-09-21 16:00:09 +0000 |
commit | d603d05398ec636029c2d0268ec0b3dccbfa5d8d (patch) | |
tree | c5b8f8f076e19199559e42a3c9a7c0ca9582c221 /sapi/cli/php_cli_server.c | |
parent | 679c87e999ef9d6f35ba636311ed84e4982cc2ed (diff) | |
download | php-git-d603d05398ec636029c2d0268ec0b3dccbfa5d8d.tar.gz |
Fixed bug #55755 (SegFault when outputting header WWW-Authenticate)
Diffstat (limited to 'sapi/cli/php_cli_server.c')
-rw-r--r-- | sapi/cli/php_cli_server.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index facb0b615a..ec3b9ddb17 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1583,6 +1583,7 @@ static void php_cli_server_client_populate_request_info(const php_cli_server_cli request_info->query_string = client->request.query_string; request_info->post_data = client->request.content; request_info->content_length = request_info->post_data_length = client->request.content_len; + request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL; if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) { request_info->content_type = *val; } @@ -1764,9 +1765,9 @@ static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server { php_cli_server_client_populate_request_info(client, &SG(request_info)); { - zval **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&val)) { - php_handle_auth_data(Z_STRVAL_PP(val) TSRMLS_CC); + char **auth; + if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { + php_handle_auth_data(*auth TSRMLS_CC); } } SG(sapi_headers).http_response_code = 200; @@ -1867,9 +1868,9 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server php_cli_server_client_populate_request_info(client, &SG(request_info)); { - zval **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&val)) { - php_handle_auth_data(Z_STRVAL_PP(val) TSRMLS_CC); + char **auth; + if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { + php_handle_auth_data(*auth TSRMLS_CC); } } SG(sapi_headers).http_response_code = 200; |