summaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-04-14 15:21:31 +0200
committerHarald Welte <laforge@gnumonks.org>2016-04-16 13:33:14 +0200
commit312bf6ce8bc56f88e49e8118f519494e71a4289a (patch)
tree434076bf0355682076b1fa1259249942b16d0a8a /openbsc/src
parent8bb6204d50373ad99b769f8cf42850ae30551c08 (diff)
gtphub_unmap_header_tei(): don't dereference unmapped_tei arg if not present (CID #57687)
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/gprs/gtphub.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c
index e8bd3ae..58300ea 100644
--- a/openbsc/src/gprs/gtphub.c
+++ b/openbsc/src/gprs/gtphub.c
@@ -1434,14 +1434,16 @@ static int gtphub_unmap_header_tei(struct gtphub_peer_port **to_port_p,
p->header_tei_rx, gtphub_port_str(from_port));
return -1;
}
- OSMO_ASSERT(*unmapped_from_tun);
+
+ if (unmapped_from_tun) {
+ OSMO_ASSERT(*unmapped_from_tun);
+ LOG(LOGL_DEBUG, "Unmapped TEI coming from: %s\n",
+ gtphub_tunnel_str(*unmapped_from_tun));
+ }
uint32_t unmapped_tei = to->tei_orig;
set_tei(p, unmapped_tei);
- LOG(LOGL_DEBUG, "Unmapped TEI coming from: %s\n",
- gtphub_tunnel_str(*unmapped_from_tun));
-
/* May be NULL for an invalidated tunnel. */
*to_port_p = to->peer;