msc_tx_common_id(): fix potential NULL pointer dereference

Reported by GCC 11.1.0.  msc_a_vsub() may return NULL.

Change-Id: Iebdd6399e819a03258398e6b7b453bda37e45a20
changes/75/24575/1
Vadim Yanitskiy 2 years ago
parent 2e21a68e83
commit 435f67f43c
  1. 2
      src/libmsc/msc_a.c

@ -1638,6 +1638,8 @@ struct msc_a *msc_a_for_vsub(const struct vlr_subscr *vsub, bool valid_conn_only
int msc_tx_common_id(struct msc_a *msc_a, enum msc_role to_role)
{
struct vlr_subscr *vsub = msc_a_vsub(msc_a);
if (vsub == NULL)
return -ENODEV;
struct ran_msg msg = {
.msg_type = RAN_MSG_COMMON_ID,
.common_id = {

Loading…
Cancel
Save