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.
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;
if (ret < 0)
return gnutls_assert_val(ret);
- /* requires padding */
return record_overhead(params->cipher, params->mac,
params->compression_algorithm);
}