diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-01-22 16:32:15 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-01-22 16:32:15 -0500 |
commit | 4ad5094c9093f342a1f96fac7d90eb1781321e9a (patch) | |
tree | 566ce4e256b8194c4b455972a3d1c53e7567211c /src | |
parent | 1fc94bfd0e0b2ab70ec51c35acde6330c8a7fd1d (diff) | |
download | tor-4ad5094c9093f342a1f96fac7d90eb1781321e9a.tar.gz tor-4ad5094c9093f342a1f96fac7d90eb1781321e9a.zip |
Avoid a possible crash in tls_log_errors.
We were checking for msg==NULL, but not lib or proc. This case can
only occur if we have an error whose string we somehow haven't loaded,
but it's worth coding defensively here.
Spotted by rieo on IRC.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/tortls.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 5b323267c1..beab5356c5 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -180,6 +180,8 @@ tls_log_errors(tor_tls_t *tls, int severity, const char *doing) lib = (const char*)ERR_lib_error_string(err); func = (const char*)ERR_func_error_string(err); if (!msg) msg = "(null)"; + if (!lib) lib = "(null)"; + if (!func) func = "(null)"; if (doing) { log(severity, LD_NET, "TLS error while %s%s%s: %s (in %s:%s)", doing, addr?" with ":"", addr?addr:"", |