From 682587748fbd4c2b98e6e989548ca61d7127a212 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 8 Mar 2011 13:35:17 +0100 Subject: [PATCH] vty: fix segfault if rf_ctl is not set This is the case of osmo-nitb, since it does not call osmo_bsc_rf_create(). term1: $ ./osmo-nitb -c ../openbsc.cfg.nanobts term2: $ telnet localhost 4242 term2: OpenBSC> show network term1: Segmentation fault --- openbsc/src/libbsc/bsc_vty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index c0909db51..1afaed312 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -189,7 +189,7 @@ static void net_dump_vty(struct vty *vty, struct gsm_network *net) dump_pchan_load_vty(vty, " ", &pl); /* show rf */ - if (net->msc_data) + if (net->msc_data && net->msc_data->rf_ctl) vty_out(vty, " Last RF Command: %s%s", net->msc_data->rf_ctl->last_state_command, VTY_NEWLINE);