1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Suppress debug output when strings may contain password

* iri.c (do_conversion): Do not print out converted strings if they
  contain an '@'. That could be an URL with embedded password.

Fixes #45825
This commit is contained in:
Tim Rühsen 2015-08-26 10:35:57 +02:00
parent d080a70a3a
commit 7bed9a6f8f

View File

@ -152,7 +152,14 @@ do_conversion (const char *tocode, const char *fromcode, char const *in_org, siz
*(s + len - outlen - done) = '\0';
xfree(in_save);
iconv_close(cd);
DEBUGP (("converted '%s' (%s) -> '%s' (%s)\n", in_org, fromcode, *out, tocode));
IF_DEBUG
{
/* not not print out embedded passwords, in_org might be an URL */
if (!strchr(in_org, '@') && !strchr(*out, '@'))
debug_logprintf ("converted '%s' (%s) -> '%s' (%s)\n", in_org, fromcode, *out, tocode);
else
debug_logprintf ("%s: logging suppressed, strings may contain password\n", __func__);
}
return true;
}
@ -193,7 +200,14 @@ do_conversion (const char *tocode, const char *fromcode, char const *in_org, siz
xfree(in_save);
iconv_close(cd);
DEBUGP (("converted '%s' (%s) -> '%s' (%s)\n", in_org, fromcode, *out, tocode));
IF_DEBUG
{
/* not not print out embedded passwords, in_org might be an URL */
if (!strchr(in_org, '@') && !strchr(*out, '@'))
debug_logprintf ("converted '%s' (%s) -> '%s' (%s)\n", in_org, fromcode, *out, tocode);
else
debug_logprintf ("%s: logging suppressed, strings may contain password\n", __func__);
}
return false;
}