]> granicus.if.org Git - php/commitdiff
SET_VAR_STR* expect a emalloc'ed copy of the string!
authorThies C. Arntzen <thies@php.net>
Thu, 7 Oct 1999 09:13:39 +0000 (09:13 +0000)
committerThies C. Arntzen <thies@php.net>
Thu, 7 Oct 1999 09:13:39 +0000 (09:13 +0000)
ChangeLog
main/php_content_types.c

index ebdfd52b324f235eb9e5aaeb333bf7163afa17bf..3665a216450b06bf160341bbf0ebc53a15212d31 100644 (file)
--- 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
index 40787b5b659ff1e8a89b6ee8c9d14d2b3511dc7d..baadb9834e2a2b5f99e60778cf1d2087235e59af 100644 (file)
@@ -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);
 }