diff options
author | teor <teor2345@gmail.com> | 2015-06-11 01:06:15 +1000 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2015-06-11 01:06:15 +1000 |
commit | e870f6285d8c490536f62c6923ad0aca9844079d (patch) | |
tree | d8fa1fe20e9436ae13fdfcd7ac5b2261c37332aa | |
parent | 64bdf040f021ca3ccb661c4056ee857e2ed44a4e (diff) | |
download | tor-e870f6285d8c490536f62c6923ad0aca9844079d.tar.gz tor-e870f6285d8c490536f62c6923ad0aca9844079d.zip |
Fix clang address of struct member always non-NULL in SSL master key
clang complains that the address of struct member in an assert in
SSL_SESSION_get_master_key is always non-NULL.
Instead, check each pointer argument is non-NULL before using it.
Fix on f90a704f1258 from 27 May 2015, not in any released version of tor.
-rw-r--r-- | src/common/tortls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 4cfe94e182..98840c15cf 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -2631,10 +2631,11 @@ SSL_get_server_random(SSL *s, uint8_t *out, size_t len) static size_t SSL_SESSION_get_master_key(SSL_SESSION *s, uint8_t *out, size_t len) { + tor_assert(s); if (len == 0) return s->master_key_length; tor_assert(len == (size_t)s->master_key_length); - tor_assert(s->master_key); + tor_assert(out); memcpy(out, s->master_key, len); return len; } |