]> granicus.if.org Git - php/commitdiff
Fix for bug #18792 submitted by t.bubeck@reinform.de
authorDan Kalowsky <kalowsky@php.net>
Fri, 16 Aug 2002 19:34:43 +0000 (19:34 +0000)
committerDan Kalowsky <kalowsky@php.net>
Fri, 16 Aug 2002 19:34:43 +0000 (19:34 +0000)
# talked this over with sterling and he believes it shouldn't break anything
# although there might be a need/desire to check for both ',' and ';'

main/rfc1867.c

index dd0651abc54648ed3ce12c2fc90f2b771e4ea779..83d981bf2d7d7538112bed35bfe35804be4316ad 100644 (file)
@@ -617,7 +617,7 @@ static char *multipart_buffer_read_body(multipart_buffer *self TSRMLS_DC)
 
 SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
 {
-       char *boundary, *s=NULL, *start_arr=NULL, *array_index=NULL;
+       char *boundary, *s=NULL, *boundary_end = NULL, *start_arr=NULL, *array_index=NULL;
        char *temp_filename=NULL, *lbuf=NULL, *abuf=NULL;
        int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0, max_file_size=0;
        zval *http_post_files=NULL;
@@ -638,6 +638,11 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
                sapi_module.sapi_error(E_WARNING, "Missing boundary in multipart/form-data POST data");
                return;
        }
+
+       /* search for the end of the boundary */
+       boundary_end = strchr(boundary, ',');
+       if (boundary_end ) *boundary_end = 0;
+
        boundary++;
        boundary_len = strlen(boundary);