mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
fix #2733
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
Fri Feb 1 10:19:44 CET 2013
|
||||
Handle case where POST data contains "key=" without value
|
||||
at the end and is not new-line terminated by invoking the
|
||||
callback with the "key" during MHD_destroy_post_processor (#2733). -CG
|
||||
|
||||
Wed Jan 30 13:09:30 CET 2013
|
||||
Adding more 'const' to allow keeping of reason phrases in ROM.
|
||||
(see mailinglist). -CG/MV
|
||||
|
||||
@@ -1062,6 +1062,13 @@ MHD_destroy_post_processor (struct MHD_PostProcessor *pp)
|
||||
|
||||
if (NULL == pp)
|
||||
return MHD_YES;
|
||||
if (PP_ProcessValue == pp->state)
|
||||
{
|
||||
/* key without terminated value left at the end of the
|
||||
buffer; fake receiving a termination character to
|
||||
ensure it is also processed */
|
||||
post_process_urlencoded (pp, "\n", 1);
|
||||
}
|
||||
/* These internal strings need cleaning up since
|
||||
the post-processing may have been interrupted
|
||||
at any stage */
|
||||
|
||||
@@ -60,11 +60,12 @@ const char *want[] = {
|
||||
"pics", "file2.gif", "image/gif", "binary", "filedata2",
|
||||
#define FORM_NESTED_END (FORM_NESTED_START + 15)
|
||||
NULL, NULL, NULL, NULL, NULL,
|
||||
#define URL_EMPTY_VALUE_DATA "key1=value1&key2="
|
||||
#define URL_EMPTY_VALUE_DATA "key1=value1&key2=&key3="
|
||||
#define URL_EMPTY_VALUE_START (FORM_NESTED_END + 5)
|
||||
"key1", NULL, NULL, NULL, "value1",
|
||||
"key2", NULL, NULL, NULL, NULL,
|
||||
#define URL_EMPTY_VALUE_END (URL_EMPTY_VALUE_START + 10)
|
||||
"key2", NULL, NULL, NULL, "",
|
||||
"key3", NULL, NULL, NULL, "",
|
||||
#define URL_EMPTY_VALUE_END (URL_EMPTY_VALUE_START + 15)
|
||||
NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
@@ -95,8 +96,8 @@ value_checker (void *cls,
|
||||
"VC: `%s' `%s' `%s' `%s' `%.*s'\n",
|
||||
key, filename, content_type, transfer_encoding, size, data);
|
||||
#endif
|
||||
if (size == 0)
|
||||
return MHD_YES;
|
||||
if ( (0 != off) && (0 == size) )
|
||||
return MHD_YES;
|
||||
if ((idx < 0) ||
|
||||
(want[idx] == NULL) ||
|
||||
(0 != strcmp (key, want[idx])) ||
|
||||
|
||||
Reference in New Issue
Block a user