Skip to content

Commit

Permalink
QUIC LCIDM: Minor fixes
Browse files Browse the repository at this point in the history
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #22673)
  • Loading branch information
hlandau committed Dec 6, 2023
1 parent 1f29585 commit 935aa14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ssl/quic/quic_lcidm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion test/quic_lcidm_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 935aa14

Please sign in to comment.