View Issue Details

IDProjectCategoryView StatusLast Update
0001680libmicrohttpdHTTP POSTpublic2011-05-20 20:19
Reporterponponli2000 Assigned ToChristian Grothoff Due Date
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 17:36

manager   ~0004329

Fixed in 15274.

Issue History

Date ModifiedUsernameFieldChange
2011-05-20 08:54ponponli2000New Issue
2011-05-20 08:54ponponli2000File Added: pp-multipart.patch
2011-05-20 17:36Christian GrothoffNote Added: 0004329
2011-05-20 17:36Christian GrothoffStatusnew => resolved
2011-05-20 17:36Christian GrothoffResolutionopen => fixed
2011-05-20 17:36Christian GrothoffAssigned To => Christian Grothoff
2011-05-20 20:19Christian GrothoffStatusresolved => closed