[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 03/05: MHD_queue_response: check whether provided status
From: |
gnunet |
Subject: |
[libmicrohttpd] 03/05: MHD_queue_response: check whether provided status code is a three digits code |
Date: |
Tue, 08 Jun 2021 08:58:20 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 45c7e2bc39a1620f2c853bd382175f874aa9f1bc
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Jun 7 12:26:28 2021 +0300
MHD_queue_response: check whether provided status code is a three digits
code
---
src/microhttpd/connection.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index e49bfe9a..0d7ba27b 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -4234,6 +4234,17 @@ MHD_queue_response (struct MHD_Connection *connection,
return MHD_NO;
}
#endif /* UPGRADE_SUPPORT */
+ if ( (100 > (status_code & (~MHD_ICY_FLAG))) ||
+ (999 < (status_code & (~MHD_ICY_FLAG))) )
+ {
+#ifdef HAVE_MESSAGES
+ MHD_DLOG (daemon,
+ _ ("Refused wrong status code (%u). " \
+ "HTTP required three digits status code!\n"),
+ (status_code & (~MHD_ICY_FLAG)));
+#endif
+ return MHD_NO;
+ }
MHD_increment_response_rc (response);
connection->response = response;
connection->responseCode = status_code;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.