Treat absent argument to crypto_log_errors as a bug.

This commit is contained in:
Nick Mathewson 2016-05-03 14:16:14 -04:00
parent d88656ec06
commit 98a590577a

View File

@ -171,13 +171,9 @@ crypto_log_errors(int severity, const char *doing)
if (!msg) msg = "(null)";
if (!lib) lib = "(null)";
if (!func) func = "(null)";
if (doing) {
tor_log(severity, LD_CRYPTO, "crypto error while %s: %s (in %s:%s)",
if (BUG(!doing)) doing = "(null)";
tor_log(severity, LD_CRYPTO, "crypto error while %s: %s (in %s:%s)",
doing, msg, lib, func);
} else {
tor_log(severity, LD_CRYPTO, "crypto error: %s (in %s:%s)",
msg, lib, func);
}
}
}