com php-src: Fixed segfault if empty POST: main/php_variables .c

From: Date: Thu, 03 Jul 2014 15:58:21 +0000
Subject: com php-src: Fixed segfault if empty POST: main/php_variables .c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79232@lists.php.net to get a copy of this message
Commit: 21ccbbad7d964c4ee00b46a40f8733bef2ee126f Author: Xinchen Hui <laruence@php.net> Thu, 3 Jul 2014 23:58:21 +0800 Parents: 96e3fd4c1df8ae6876005a9a838b3607f362f861 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=21ccbbad7d964c4ee00b46a40f8733bef2ee126f Log: Fixed segfault if empty POST Changed paths: M main/php_variables.c Diff: diff --git a/main/php_variables.c b/main/php_variables.c index 30a8482..fbd91dc 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -328,9 +328,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler) smart_str_appendl(&post_data.str, buf, len); if (SUCCESS != add_post_vars(arr, &post_data, 0 TSRMLS_CC)) { - if (post_data.str.s) { - smart_str_free(&post_data.str); - } + smart_str_free(&post_data.str); return; } } @@ -340,8 +338,8 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler) } } - add_post_vars(arr, &post_data, 1 TSRMLS_CC); if (post_data.str.s) { + add_post_vars(arr, &post_data, 1 TSRMLS_CC); smart_str_free(&post_data.str); } }

« previous php.cvs (#79232) next »