QUIC LCIDM: Minor fixes

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22673)
This commit is contained in:
Hugo Landau 2023-11-09 11:11:17 +00:00
parent 1f2958536e
commit 935aa14344
2 changed files with 7 additions and 1 deletions

View File

@ -149,6 +149,9 @@ static QUIC_LCID *lcidm_get_lcid(const QUIC_LCIDM *lcidm, const QUIC_CONN_ID *lc
key.cid = *lcid;
if (key.cid.id_len > QUIC_MAX_CONN_ID_LEN)
return NULL;
return lh_QUIC_LCID_retrieve(lcidm->lcids, &key);
}
@ -208,6 +211,9 @@ static QUIC_LCID *lcidm_conn_new_lcid(QUIC_LCIDM *lcidm, QUIC_LCIDM_CONN *conn,
{
QUIC_LCID *lcid_obj;
if (lcid->id_len > QUIC_MAX_CONN_ID_LEN)
return NULL;
if ((lcid_obj = OPENSSL_zalloc(sizeof(*lcid_obj))) == NULL)
return NULL;

View File

@ -23,7 +23,7 @@ static int test_lcidm(void)
int testresult = 0;
QUIC_LCIDM *lcidm;
size_t lcid_len = 10; /* != ODCID len */
QUIC_CONN_ID lcid_1, lcid_dummy, lcid_init;
QUIC_CONN_ID lcid_1, lcid_dummy, lcid_init = {0};
OSSL_QUIC_FRAME_NEW_CONN_ID ncid_frame_1, ncid_frame_2, ncid_frame_3;
void *opaque = NULL;
uint64_t seq_num = UINT64_MAX;