aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-10-28 14:01:00 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2022-10-29 01:06:27 +0200
commit764820e742e73ca2d1fc47e8d0f57c8025046ff3 (patch)
tree8f8a0cbbde81ee77eae30e8b5589d34c186fd486
parent77fd0a589cec2804ee761351f1fec90b4d811793 (diff)
osmux: Fix null ptr dereference sending UL data before the remote is configured
-rw-r--r--src/common/osmux.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/osmux.c b/src/common/osmux.c
index 3f137e54..83730cec 100644
--- a/src/common/osmux.c
+++ b/src/common/osmux.c
@@ -493,6 +493,12 @@ int lchan_osmux_send_frame(struct gsm_lchan *lchan, const uint8_t *payload,
rtph = (struct rtp_hdr *)msgb_data(msg);
rtph->marker = marker;
+ /* Avoid using the osmux.in if not yet connected. */
+ if (!lchan_osmux_connected(lchan)) {
+ msgb_free(msg);
+ return -1;
+ }
+
while ((rc = osmux_xfrm_input(lchan->abis_ip.osmux.in, msg,
lchan->abis_ip.osmux.remote_cid)) > 0) {
/* batch full, build and deliver it */