aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-05 18:00:05 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-05 18:00:05 +0200
commitb91e5f1da416ca3ab201b81df7f266af6b015db2 (patch)
tree968bc7874d93119bc7220c9a310d392e49193a7a
parent07bb5094344876a85485c9ffee3247ff38fcece3 (diff)
nat: Avoid crashing when we have no pending transaction
-rw-r--r--openbsc/src/nat/bsc_mgcp_utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index 0c666c075..1ccb1364e 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -204,6 +204,9 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
for (i = 1; i < bsc->nat->mgcp_cfg->number_endpoints; ++i) {
if (bsc->nat->bsc_endpoints[i].bsc != bsc)
continue;
+ /* no one listening? a bug? */
+ if (!bsc->nat->bsc_endpoints[i].transaction_id)
+ continue;
if (strcmp(transaction_id, bsc->nat->bsc_endpoints[i].transaction_id) != 0)
continue;