libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 1efb758b79f36e248dfcef68517e9b4ca482b1b7
parent c4246b5251bb8ee45ca66b4d24597fa26762d729
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Fri, 17 Jun 2022 20:14:58 +0300

Fixed check for URL match to handle URLs with binary zero

Diffstat:
Msrc/microhttpd/digestauth.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c @@ -1801,11 +1801,11 @@ digest_auth_check_all_inner (struct MHD_Connection *connection, *qmark = '\0'; /* Need to unescape URI before comparing with connection->url */ - daemon->unescape_callback (daemon->unescape_callback_cls, - connection, - uri); - if (0 != strcmp (uri, - connection->url)) + uri_len = daemon->unescape_callback (daemon->unescape_callback_cls, + connection, + uri); + if ((uri_len != connection->url_len) || + (0 != memcmp (uri, connection->url, uri_len))) { #ifdef HAVE_MESSAGES MHD_DLOG (daemon,