aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-20 17:22:36 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-27 09:47:00 +0100
commit6a1d428f5692de5281e287fd6bf430dba4ae84d5 (patch)
treec0a5459e06bb4a6010a7faaf539193565a9dd41a /openbsc/src
parentc79beec8f6cd3976fc92d296ebd0b788997f9ce1 (diff)
gbproxy: Fix segfault for VTY delete-gbproxy-link
Currently the code segfaults when the link shall be deleted by IMSI when the IMSI has not been set yet. This patch adds a NULL check to skip the entry before calling gsm48_mi_to_string, Adresses: Program received signal SIGSEGV, Segmentation fault. 0xb693af77 in gsm48_mi_to_string (string=0xbfffe020 "", str_len=200, mi=0x0, mi_len=0) at gsm48.c:360 360 mi_type = mi[0] & GSM_MI_TYPE_MASK; str_len=200, mi=0x0, mi_len=0) at gsm48.c:360 self=0x807c9a0 <delete_gb_link_by_id_cmd>, vty=0xb4303c70, argc=3, argv=0xbfffe1c0) at gb_proxy_vty.c:670 ... Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/gprs/gb_proxy_vty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c
index 8a7523c4e..3042cf570 100644
--- a/openbsc/src/gprs/gb_proxy_vty.c
+++ b/openbsc/src/gprs/gb_proxy_vty.c
@@ -666,6 +666,8 @@ DEFUN(delete_gb_link_by_id, delete_gb_link_by_id_cmd,
continue;
break;
case MATCH_IMSI:
+ if (!link_info->imsi)
+ continue;
mi_buf[0] = '\0';
gsm48_mi_to_string(mi_buf, sizeof(mi_buf),
link_info->imsi,