VLR: fix potential NULL dereference

The vlr_subscr_get() can return NULL if its argument is NULL
(which isn't checked for) so before dereferencing it's result
we should check for it.

Change-Id: I13632908d0b67323202effa9dd6f29732a12cc91
This commit is contained in:
Max 2018-02-12 16:51:03 +01:00 committed by Neels Hofmeyr
parent da21a52c92
commit 48d4ec06e1
1 changed files with 2 additions and 0 deletions

View File

@ -3721,8 +3721,10 @@ static void msc_vlr_subscr_assoc(void *msc_conn_ref,
struct vlr_subscr *vsub)
{
struct gsm_subscriber_connection *conn = msc_conn_ref;
OSMO_ASSERT(vsub);
OSMO_ASSERT(!conn->vsub);
conn->vsub = vlr_subscr_get(vsub);
OSMO_ASSERT(conn->vsub);
conn->vsub->cs.attached_via_ran = conn->via_ran;
}