From b536bcd14091a510aadeada637e541f9849bb724 Mon Sep 17 00:00:00 2001 From: Martin Hecht Date: Thu, 2 Nov 2023 10:50:52 +0100 Subject: [PATCH] fix issues with masking password in debug output (#1149) --- src/http.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/http.c b/src/http.c index aafd8ad3..856df670 100644 --- a/src/http.c +++ b/src/http.c @@ -90,13 +90,12 @@ int http_send(struct tunnel *tunnel, const char *request, ...) char password[3 * PASSWORD_SIZE + 1]; url_encode(password, tunnel->config->password); - pwstart = strstr(logbuffer, password); - if (pwstart != NULL) { + while ((pwstart = strstr(logbuffer, password))) { int pos, pwlen, i; pos = pwstart - logbuffer; - pwlen = strlen(tunnel->config->password); + pwlen = strlen(password); for (i = pos; i < pos + pwlen; i++) logbuffer[i] = '*'; }