laforge has uploaded this change for review.
fix segfault on 'show octoi-server' if no server configured
Change-Id: I23697f858337948555456b71539b9afe8c3730b9
---
M src/octoi/octoi_srv_vty.c
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/18/27718/1
diff --git a/src/octoi/octoi_srv_vty.c b/src/octoi/octoi_srv_vty.c
index e5b91c7..c9f63cb 100644
--- a/src/octoi/octoi_srv_vty.c
+++ b/src/octoi/octoi_srv_vty.c
@@ -359,9 +359,13 @@
SHOW_STR "Display information about the OCTOI Server\n")
{
struct octoi_server *srv = g_octoi->server;
- struct octoi_sock *sock = srv->sock;
- vty_show_octoi_sock(vty, sock);
+ if (!srv) {
+ vty_out(vty, "%% No OCTOI server present%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ vty_show_octoi_sock(vty, srv->sock);
return CMD_SUCCESS;
}
To view, visit change 27718. To unsubscribe, or for help writing mail filters, visit settings.