aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-04-04 11:53:18 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-04-04 11:53:18 +0200
commitbd30cd3e1f47bffb966d3e4ccfc69d91661d65fe (patch)
tree178ddc1d8c1ea636402f882f8d1693f8144b3a0c
parentcb4567f117fff4396e93257eeaa4e9fbee31bfda (diff)
bsc/msc: Extension can never be NULL use strlen instead
Fixes: Coverity CID 1040717
-rw-r--r--openbsc/src/libbsc/bsc_vty.c2
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 2a4d0b3fb..8bfbb240d 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -890,7 +890,7 @@ static void subscr_dump_vty(struct vty *vty, struct gsm_subscriber *subscr)
subscr->authorized, VTY_NEWLINE);
if (strlen(subscr->name))
vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE);
- if (subscr->extension)
+ if (strlen(subscr->extension))
vty_out(vty, " Extension: %s%s", subscr->extension,
VTY_NEWLINE);
vty_out(vty, " IMSI: %s%s", subscr->imsi, VTY_NEWLINE);
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 923cba062..5b727ef4c 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -62,7 +62,7 @@ static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr,
subscr->authorized, VTY_NEWLINE);
if (strlen(subscr->name))
vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE);
- if (subscr->extension)
+ if (strlen(subscr->extension))
vty_out(vty, " Extension: %s%s", subscr->extension,
VTY_NEWLINE);
vty_out(vty, " LAC: %d/0x%x%s",