diff options
| author | Xinchen Hui <laruence@php.net> | 2014-07-03 23:58:21 +0800 | 
|---|---|---|
| committer | Xinchen Hui <laruence@php.net> | 2014-07-03 23:58:21 +0800 | 
| commit | 21ccbbad7d964c4ee00b46a40f8733bef2ee126f (patch) | |
| tree | 1806aef2b584ab62025aec946a4268acbc831676 /main/php_variables.c | |
| parent | 96e3fd4c1df8ae6876005a9a838b3607f362f861 (diff) | |
| download | php-git-21ccbbad7d964c4ee00b46a40f8733bef2ee126f.tar.gz | |
Fixed segfault if empty POST
Diffstat (limited to 'main/php_variables.c')
| -rw-r--r-- | main/php_variables.c | 6 | 
1 files changed, 2 insertions, 4 deletions
| diff --git a/main/php_variables.c b/main/php_variables.c index 30a84822af..fbd91dc286 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);  		}  	} | 
