Skip to content

Commit

Permalink
fix issues with masking password in debug output (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbaseman authored Nov 2, 2023
1 parent 6181a4a commit b536bcd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = '*';
}
Expand Down

0 comments on commit b536bcd

Please sign in to comment.