From: Thies C. Arntzen Date: Thu, 7 Oct 1999 09:13:39 +0000 (+0000) Subject: SET_VAR_STR* expect a emalloc'ed copy of the string! X-Git-Tag: php-4.0b3_RC2~283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=601b837c56f73b63768dfef0723a290ad39f3c43;p=php SET_VAR_STR* expect a emalloc'ed copy of the string! --- diff --git a/ChangeLog b/ChangeLog index ebdfd52b32..3665a21645 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ PHP 4.0 CHANGE LOG ChangeLog ?? ?? 1999, Version 4.0 Beta 3 +- Fixed crash in HTTP_RAW_POST_DATA handling (Thies) - You can use resources as array-indices again (Thies, Zend library) - Fixed pg_fetch_array() with three arguments (Sascha) Patch submitted by: brian@soda.berkeley.edu diff --git a/main/php_content_types.c b/main/php_content_types.c index 40787b5b65..baadb9834e 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -10,10 +10,12 @@ static sapi_post_content_type_reader php_post_content_types[] = { SAPI_POST_READER_FUNC(php_default_post_reader) { + char *data; ELS_FETCH(); sapi_read_standard_form_data(content_type_dup SLS_CC); - SET_VAR_STRINGL("HTTP_RAW_POST_DATA", SG(request_info).post_data, SG(request_info).post_data_length); + data = estrndup(SG(request_info).post_data,SG(request_info).post_data_length); + SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, SG(request_info).post_data_length); }