pcu_l1_if: do not copy IMSI when it is NULL

The parameter imsi of pcu_l1if_tx_pch_dt() could be NULL. In those cases
we should ensure that struct gsm_pcu_if_pch_dt is populated with a zero
length string.

Related: OS#5198
Change-Id: I9192d50dd78be0a72ffdb9bfb9ed66aef085bcf1
This commit is contained in:
Philipp Maier 2023-03-07 18:19:08 +01:00
parent efae56dc52
commit 07e06d38fb
1 changed files with 3 additions and 2 deletions

View File

@ -294,10 +294,11 @@ void pcu_l1if_tx_pch_dt(struct gprs_rlcmac_bts *bts, bitvec *block, int plen, co
* it is not guaranteed to work with other message types. The prepended TLLI will be used as an identifier in
* the confirmation message. */
struct gsm_pcu_if_pch_dt pch_dt;
struct gsm_pcu_if_pch_dt pch_dt = { 0 };
pch_dt.tlli = tlli;
strcpy(pch_dt.imsi, imsi);
if (imsi)
OSMO_STRLCPY_ARRAY(pch_dt.imsi, imsi);
pch_dt.data[0] = (plen << 2) | 0x01;
bitvec_pack(block, pch_dt.data + 1);