gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 03/03: postprocessor: fixed empty key processing


From: gnunet
Subject: [libmicrohttpd] 03/03: postprocessor: fixed empty key processing
Date: Wed, 15 Sep 2021 12:51:23 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit bbc57f9386bbd30e21320c59c6b76f91448fab0f
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Sep 15 13:32:47 2021 +0300

    postprocessor: fixed empty key processing
---
 src/microhttpd/postprocessor.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
index 1e4ce7d0..6f1d07e2 100644
--- a/src/microhttpd/postprocessor.c
+++ b/src/microhttpd/postprocessor.c
@@ -521,6 +521,12 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
       case '=':
         /* Case: 'key=' */
         end_key = &post_data[poff];
+        if ((start_key == end_key) && (0 == pp->buffer_pos))
+        {
+          /* Empty key with value */
+          pp->state = PP_Error;
+          continue;
+        }
         poff++;
         pp->state = PP_ProcessValue;
         break;
@@ -530,6 +536,12 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
         mhd_assert (NULL == start_value);
         mhd_assert (NULL == end_value);
         poff++;
+        if ((start_key == end_key) && (0 == pp->buffer_pos))
+        {
+          /* Empty key without value */
+          start_key = NULL;
+          continue;
+        }
         pp->state = PP_Callback;
         break;
       case '\n':

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]