diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-07-22 15:36:55 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-07-22 15:37:17 +0200 |
commit | f1b64b5f37b8922cc66283458699d7fcf666171d (patch) | |
tree | 26d8a868f9e29318b1208f8ff7a8a5cd5e836af3 /lib/dtls.c | |
parent | c8c4d57860a5568a705efe6f72cbf05f1608468a (diff) | |
download | gnutls-f1b64b5f37b8922cc66283458699d7fcf666171d.tar.gz |
dtls: added a null pointer check in record_overhead
According to my reading this check is unnecessary as in
no case a null pointer can be encountered. However gcc6
warns about a null pointer derefence and thus adding it,
to be safe.
Diffstat (limited to 'lib/dtls.c')
-rw-r--r-- | lib/dtls.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/dtls.c b/lib/dtls.c index 31497183f3..50d5dcefc4 100644 --- a/lib/dtls.c +++ b/lib/dtls.c @@ -500,6 +500,9 @@ static int record_overhead(const cipher_entry_st * cipher, int total = 0; int t, ret; + if (unlikely(cipher == NULL)) + return 0; + if (_gnutls_cipher_type(cipher) == CIPHER_BLOCK) { t = _gnutls_cipher_get_explicit_iv_size(cipher); total += t; @@ -598,7 +601,6 @@ static int record_overhead_rt(gnutls_session_t session) if (ret < 0) return gnutls_assert_val(ret); - /* requires padding */ return record_overhead(params->cipher, params->mac, params->compression_algorithm); } |