llc: fix l3par check in gprs_llc_lle_generate_xid()

A NULL pointer dereference is possible if this function is called
with l3par being NULL, but l3par_len being greater than 0.

Change-Id: I80c18a45a248b85901d455bfb17e81734fa5961d
Fixes: CID#300602
This commit is contained in:
Vadim Yanitskiy 2023-12-09 05:19:06 +07:00
parent 0160c666fe
commit be55e1fd83
1 changed files with 1 additions and 1 deletions

View File

@ -475,7 +475,7 @@ static int gprs_llc_lle_generate_xid(struct gprs_llc_lle *lle, uint8_t *bytes, i
xid_fields[2].type = OSMO_GPRS_LLC_XID_T_N201_I;
xid_fields[2].val = lle->params.n201_i;
if (l3par_len > 0) {
if (l3par != NULL && l3par_len > 0) {
xid_fields[3].type = OSMO_GPRS_LLC_XID_T_L3_PAR;
xid_fields[3].var.val_len = l3par_len;
if (l3par_len > 0) {