[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.
- [libmicrohttpd] branch master updated (746dae6a -> 381f2705), gnunet, 2021/10/17
- [libmicrohttpd] 02/05: Removed leftover after 3a02f18ca6a66997614cebf1231c86ad33148ad2, gnunet, 2021/10/17
- [libmicrohttpd] 01/05: get_next_header_line(): improved and fixed comments, gnunet, 2021/10/17
- [libmicrohttpd] 03/05: Fixed parsing of bare CR as end-of-line in HTTP headers, gnunet, 2021/10/17
- [libmicrohttpd] 05/05: Fixed parsing of "\r\r", "\r", "\n\r" and "\n\n" as a single linefeed for chunked upload,
gnunet <=
- [libmicrohttpd] 04/05: internal.h: fixed doxy for read buffer, gnunet, 2021/10/17