From a6ba6a370b130942441a33545e46e992286549f2 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 10 Oct 2016 03:24:05 +0200 Subject: abis_rsl_rx_dchan(): guard against lchan_lookup() returning NULL Found this by coincidence, no actual failure case was observed. lchan_lookup() does have a return NULL code path, so we should not blindly use its returned pointer. Change-Id: I34ce126d36420b8194c88c0faa865294334a6658 --- openbsc/src/libbsc/abis_rsl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index dc4ede294..316fc3fed 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1456,6 +1456,8 @@ static int abis_rsl_rx_dchan(struct msgb *msg) msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr, "Abis RSL rx DCHAN: "); + if (!msg->lchan) + return -1; ts_name = gsm_lchan_name(msg->lchan); switch (rslh->c.msg_type) { -- cgit v1.2.3