diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2022-10-12 22:16:12 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2022-10-12 22:16:12 +0200 |
commit | 6005fb3ea81340ca975c5091722394c9e811fb13 (patch) | |
tree | 22b3e66030045f39419f2fc26aae0d3c818459f9 /src | |
parent | 9d452333379b989f07109aec3a7dfb21b84ced5a (diff) |
octoi: Prevent segfault on 'show octoi-clients if a client has no line
This can happen if the specified device in the config isn't plugged
in for instance, no line is created ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I594463591f2945a04ccd708f16788034cc1dfc57
Diffstat (limited to 'src')
-rw-r--r-- | src/octoi/octoi_fsm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/octoi/octoi_fsm.c b/src/octoi/octoi_fsm.c index 39790fa..06d2105 100644 --- a/src/octoi/octoi_fsm.c +++ b/src/octoi/octoi_fsm.c @@ -240,7 +240,9 @@ void vty_show_octoi_sock(struct vty *vty, struct octoi_sock *sock) vty_out(vty, " Peer '%s', Remote "OSMO_SOCKADDR_STR_FMT", State %s%s", peer->name, OSMO_SOCKADDR_STR_FMT_ARGS(&peer->cfg.remote), osmo_fsm_inst_state_name(peer->priv), VTY_NEWLINE); - vty_out_rate_ctr_group(vty, " ", peer->iline->ctrs); - vty_out_stat_item_group(vty, " ", peer->iline->stats); + if (peer->iline) { + vty_out_rate_ctr_group(vty, " ", peer->iline->ctrs); + vty_out_stat_item_group(vty, " ", peer->iline->stats); + } } } |