aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-12-07 15:58:25 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-12-08 01:38:58 +0100
commitfe12797736ba85878c3245acdd1a83750f9c97fa (patch)
tree8ad3db57f5da945e360b119c03c9dc67e036e5b3 /openbsc
parent08197302a9cf60b189eb96779f7d0d8424f5cdef (diff)
vlr_sub_name(): be robust against NULL pointer
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/libvlr/vlr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsc/src/libvlr/vlr.c b/openbsc/src/libvlr/vlr.c
index e9e32f9c4..411834ed6 100644
--- a/openbsc/src/libvlr/vlr.c
+++ b/openbsc/src/libvlr/vlr.c
@@ -71,6 +71,8 @@ uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer)
const char *vlr_sub_name(struct vlr_subscriber *vsub)
{
static char buf[32];
+ if (!vsub)
+ return "-";
if (vsub->imsi[0])
strncpy(buf, vsub->imsi, sizeof(buf));
else