summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-10-10 03:24:05 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-10-10 03:24:09 +0200
commita6ba6a370b130942441a33545e46e992286549f2 (patch)
treec9c5df9a5461cb2461a5fb72f3dcf8f20b7e0d2f
parent5275c152e597e7c8e1d80ea38103892af27d0879 (diff)
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
-rw-r--r--openbsc/src/libbsc/abis_rsl.c2
1 files changed, 2 insertions, 0 deletions
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) {