From 0653c1561168ca43445bf027a3e57827890c06d0 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 5 May 2018 23:15:06 +0200 Subject: several updates to address issues found by clang static analyzer Signed-off-by: Nikos Mavrogiannopoulos --- lib/constate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/constate.c') diff --git a/lib/constate.c b/lib/constate.c index 62a1239718..cc8b817715 100644 --- a/lib/constate.c +++ b/lib/constate.c @@ -191,7 +191,7 @@ _tls13_update_keys(gnutls_session_t session, hs_stage_t stage, uint8_t iv_block[MAX_CIPHER_IV_SIZE]; char buf[65]; record_state_st *upd_state; - record_parameters_st *prev; + record_parameters_st *prev = NULL; int ret; /* generate new keys for direction needed and copy old from previous epoch */ @@ -202,6 +202,7 @@ _tls13_update_keys(gnutls_session_t session, hs_stage_t stage, ret = _gnutls_epoch_get(session, EPOCH_READ_CURRENT, &prev); if (ret < 0) return gnutls_assert_val(ret); + assert(prev != NULL); params->read.sequence_number = prev->read.sequence_number; @@ -226,6 +227,7 @@ _tls13_update_keys(gnutls_session_t session, hs_stage_t stage, ret = _gnutls_epoch_get(session, EPOCH_WRITE_CURRENT, &prev); if (ret < 0) return gnutls_assert_val(ret); + assert(prev != NULL); params->write.sequence_number = prev->write.sequence_number; -- cgit v1.2.1