aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-17 15:19:57 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-17 15:22:30 +0200
commitd17bc7b3a8bce2c507a2e72459b34c07b7fdcd52 (patch)
treeab46181cb17acbc5713891f548e5a9d84fcaad39 /openbsc/src
parenta334e90ddf99697ad6b18df80f1cd7473b2314d4 (diff)
mgcp: Avoid crashing when rtpmap is not complete
The NAT sends an incomplete SDP file for the purpose of informing the BSC about the remote IP/PORT early. The case of an incomplete SDP file was not considered. Check if there is a codec and if not skip it. TODO: We need to have a better end-point life cycle test.
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/libmgcp/mgcp_sdp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/src/libmgcp/mgcp_sdp.c b/openbsc/src/libmgcp/mgcp_sdp.c
index 33837b9af..aa4ef3054 100644
--- a/openbsc/src/libmgcp/mgcp_sdp.c
+++ b/openbsc/src/libmgcp/mgcp_sdp.c
@@ -159,6 +159,9 @@ int is_codec_compatible(struct mgcp_endpoint *endp, struct sdp_rtp_map *codec)
char *bts_codec;
char audio_codec[64];
+ if (!codec->codec_name)
+ return 0;
+
/*
* GSM, GSM/8000 and GSM/8000/1 should all be compatible.. let's go
* by name first.