View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001447 | libmicrohttpd | HTTP POST | public | 2009-02-02 11:01 | 2009-02-08 22:20 |
| Reporter | Simon Newton | Assigned To | Christian Grothoff | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | Git master | ||||
| Summary | 0001447: Size argument in MHD_PostDataIterator doesn't account for unescaped data | ||||
| Description | The size argument passed to a MHD_PostDataIterator doesn't account for escaped characters in the form data. The bug is here: xbuf[xoff] = '\0'; /* 0-terminate in preparation * MHD_http_unescape (xbuf); // ^ this changes the size of the buffer /* finally: call application! */ | ||||
| Tags | No tags attached. | ||||
| Attached Files | invalid_size.diff (992 bytes)
Index: postprocessor_test.c
===================================================================
--- postprocessor_test.c (revision 8149)
+++ postprocessor_test.c (working copy)
@@ -41,9 +41,9 @@
* five NULL-entries.
*/
const char *want[] = {
-#define URL_DATA "abc=def&x=5"
+#define URL_DATA "abc=def%2C&x=5"
#define URL_START 0
- "abc", NULL, NULL, NULL, "def",
+ "abc", NULL, NULL, NULL, "def,",
"x", NULL, NULL, NULL, "5",
#define URL_END (URL_START + 10)
NULL, NULL, NULL, NULL, NULL,
Index: postprocessor.c
===================================================================
--- postprocessor.c (revision 8149)
+++ postprocessor.c (working copy)
@@ -404,6 +404,7 @@
/* unescape */
xbuf[xoff] = '\0'; /* 0-terminate in preparation */
MHD_http_unescape (xbuf);
+ xoff = strlen(xbuf);
/* finally: call application! */
if (MHD_NO == pp->ikvi (pp->cls, MHD_POSTDATA_KIND, (const char *) &pp[1], /* key */
| ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2009-02-02 11:01 | Simon Newton | New Issue | |
| 2009-02-02 11:01 | Simon Newton | File Added: invalid_size.diff | |
| 2009-02-02 22:22 | Christian Grothoff | Status | new => resolved |
| 2009-02-02 22:22 | Christian Grothoff | Resolution | open => fixed |
| 2009-02-02 22:22 | Christian Grothoff | Assigned To | => Christian Grothoff |
| 2009-02-08 22:20 | Christian Grothoff | Status | resolved => closed |