[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 07/11: Added tracking of the request URL length.
From: |
gnunet |
Subject: |
[libmicrohttpd] 07/11: Added tracking of the request URL length. |
Date: |
Wed, 22 Jun 2022 20:00:13 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit c4246b5251bb8ee45ca66b4d24597fa26762d729
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Jun 17 20:11:32 2022 +0300
Added tracking of the request URL length.
URL may have binary zeros after url-decoding, the length helps to detect
such situations.
---
src/microhttpd/connection.c | 14 +++++++++++---
src/microhttpd/internal.h | 5 +++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 463fc88e..9068ee08 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2427,6 +2427,7 @@ transmit_error_response_len (struct MHD_Connection
*connection,
connection->version = NULL;
connection->method = NULL;
connection->url = NULL;
+ connection->url_len = 0;
connection->last = NULL;
connection->colon = NULL;
connection->headers_received = NULL;
@@ -3366,9 +3367,15 @@ parse_initial_message_line (struct MHD_Connection
*connection,
/* unescape URI *after* searching for arguments and log callback */
if (NULL != uri)
- daemon->unescape_callback (daemon->unescape_callback_cls,
- connection,
- uri);
+ {
+ connection->url_len =
+ daemon->unescape_callback (daemon->unescape_callback_cls,
+ connection,
+ uri);
+ }
+ else
+ connection->url_len = 0;
+
connection->url = curi;
return MHD_YES;
}
@@ -4755,6 +4762,7 @@ connection_reset (struct MHD_Connection *connection,
c->method = NULL;
c->http_mthd = MHD_HTTP_MTHD_NO_METHOD;
c->url = NULL;
+ c->url_len = 0;
memset (&c->rp_props, 0, sizeof(c->rp_props));
c->write_buffer = NULL;
c->write_buffer_size = 0;
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 1fbb6e65..6906e1bb 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -1033,6 +1033,11 @@ struct MHD_Connection
*/
const char *url;
+ /**
+ * The length of the @a url in characters, not including the terminating
zero.
+ */
+ size_t url_len;
+
/**
* HTTP version string (i.e. http/1.1). Allocated
* in pool.
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (1c181be2 -> 8b01c152), gnunet, 2022/06/22
- [libmicrohttpd] 04/11: test_digestauth{._with_arguments}: do test really with arguments, gnunet, 2022/06/22
- [libmicrohttpd] 03/11: configure: removed unused variable, gnunet, 2022/06/22
- [libmicrohttpd] 07/11: Added tracking of the request URL length.,
gnunet <=
- [libmicrohttpd] 10/11: digestauth.h: added some doxy, gnunet, 2022/06/22
- [libmicrohttpd] 01/11: configure: removed unneeded special flags for Darwin, gnunet, 2022/06/22
- [libmicrohttpd] 06/11: digest_auth_check_all(): simplified, improved readability, gnunet, 2022/06/22
- [libmicrohttpd] 05/11: MHD_parse_arguments_(): refactored, allow cls for the callback, gnunet, 2022/06/22
- [libmicrohttpd] 08/11: Fixed check for URL match to handle URLs with binary zero, gnunet, 2022/06/22
- [libmicrohttpd] 02/11: configure: added basic support for AIX XLC flags, gnunet, 2022/06/22
- [libmicrohttpd] 09/11: digestauth: removed now unused do-while scope, gnunet, 2022/06/22
- [libmicrohttpd] 11/11: mhd_str.h: fixed doxy, gnunet, 2022/06/22