View Issue Details

IDProjectCategoryView StatusLast Update
0001680libmicrohttpdHTTP POSTpublic2011-05-20 22:19
Reporterponponli2000 Assigned ToChristian Grothoff  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.10 
Summary0001680: post processor doesn't handle multipart/form-data correctly
DescriptionIt cannot process HTTP POST requests made by libcurl.
For example, making a HTTP POST request like following:

Content-Type: multipart/form-data; boundary=----------------------------dfb9171b6138

------------------------------dfb9171b6138
Content-Disposition: form-data; name="field"

hello
------------------------------dfb9171b6138--

Then, the value parsed by the post processor will be:
hello
------------------------------dfb9171b6138--


-----------------------------dfb9171b6138--

--------------------------dfb9171b6138--

The result contains garbage data. It's because the implementation of pp doesn't handle the string properly.
I generate a patch for the bug fix. Please see the attached file.
TagsNo tags attached.
Attached Files
pp-multipart.patch (385 bytes)   
--- postprocessor.c	2010-12-26 04:03:06.000000000 +0800
+++ postprocessor.c.new	2011-05-20 16:46:03.712987555 +0800
@@ -650,6 +650,7 @@
               pp->state = next_state;
               pp->dash_state = next_dash_state;
               (*ioffptr) += pp->blen + 4;       /* skip boundary as well */
+              buf[newline] = '\0';
               break;
             }
         }
pp-multipart.patch (385 bytes)   

Activities

Christian Grothoff

2011-05-20 19:36

manager   ~0004329

Fixed in 15274.

Issue History

Date Modified Username Field Change
2011-05-20 10:54 ponponli2000 New Issue
2011-05-20 10:54 ponponli2000 File Added: pp-multipart.patch
2011-05-20 19:36 Christian Grothoff Note Added: 0004329
2011-05-20 19:36 Christian Grothoff Status new => resolved
2011-05-20 19:36 Christian Grothoff Resolution open => fixed
2011-05-20 19:36 Christian Grothoff Assigned To => Christian Grothoff
2011-05-20 22:19 Christian Grothoff Status resolved => closed