gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 05/05: Fixed parsing of "\r\r", "\r", "\n\r" and "\n\n"


From: gnunet
Subject: [libmicrohttpd] 05/05: Fixed parsing of "\r\r", "\r", "\n\r" and "\n\n" as a single linefeed for chunked upload
Date: Sun, 17 Oct 2021 16:31:58 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 381f2705a6236209c096c71d2cef507bd50fb7e3
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Oct 17 17:31:37 2021 +0300

    Fixed parsing of "\r\r", "\r", "\n\r" and "\n\n" as a single linefeed for 
chunked upload
---
 src/microhttpd/connection.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 53e3b9ec..d524954a 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3096,12 +3096,11 @@ process_request_body (struct MHD_Connection *connection)
         size_t i;
         /* skip new line at the *end* of a chunk */
         i = 0;
-        if ( ('\r' == buffer_head[i]) ||
-             ('\n' == buffer_head[i]) )
-          i++;                  /* skip 1st part of line feed */
-        if ( ('\r' == buffer_head[i]) ||
-             ('\n' == buffer_head[i]) )
-          i++;                  /* skip 2nd part of line feed */
+        if ( ('\r' == buffer_head[i]) &&
+             ('\n' == buffer_head[i + 1]) )
+          i += 2;                        /* skip CRLF */
+        else if ('\n' == buffer_head[i]) /* TODO: Add MHD option to disallow */
+          i++;                           /* skip bare LF */
         if (0 == i)
         {
           /* malformed encoding */

-- 
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]