]> granicus.if.org Git - php/commitdiff
Fixed bug #55755 (SegFault when outputting header WWW-Authenticate)
authorXinchen Hui <laruence@php.net>
Wed, 21 Sep 2011 16:00:09 +0000 (16:00 +0000)
committerXinchen Hui <laruence@php.net>
Wed, 21 Sep 2011 16:00:09 +0000 (16:00 +0000)
NEWS
sapi/cli/php_cli_server.c

diff --git a/NEWS b/NEWS
index 5905b5710db7aebf70a5159abbf1cfec7236607f..5c9e65c66beb8ded2d0af2794107175043e62d2b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ PHP                                                                        NEWS
   . Fixed bug #55726 (Changing the working directory makes router script
     inaccessible). (Laruence)
   . Fixed bug #55747 (request headers missed in $_SERVER). (Laruence)
+  . Fixed bug #55755 (SegFault when outputting header WWW-Authenticate). (Laruence)
 
 15 Sep 2011, PHP 5.4.0 Beta
 - General improvements:
index facb0b615ac2b369033761bc38f0e617d16cfc9f..ec3b9ddb174e2d99a3c3476c0a00ce9b8b10266e 100644 (file)
@@ -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;