gtphub: fix possible NULL deref: don't print NULL tunnel

Fixes: coverity CID#158302
Change-Id: Ic500a3eb0c49393c7962a20e61eb57fd467208d3
This commit is contained in:
Neels Hofmeyr 2016-12-16 13:09:00 +01:00
parent ecdfd6d097
commit ea619f1704
1 changed files with 3 additions and 0 deletions

View File

@ -1039,6 +1039,9 @@ const char *gtphub_tunnel_str(struct gtphub_tunnel *tun)
int left = sizeof(buf);
int l;
if (!tun)
return "null-tunnel";
APPEND("TEI=%x: ", tun->tei_repl);
APPEND("%s", gtphub_tunnel_side_str(tun, GTPH_SIDE_SGSN));
APPEND(" <-> %s", gtphub_tunnel_side_str(tun, GTPH_SIDE_GGSN));