[PATCH] bssgp: Fix VTY command 'show bssgp nsei N'

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jacob Erlbeck jerlbeck at sysmocom.de
Mon Nov 10 07:27:15 UTC 2014


Currently this command segfaults (at least when ASAN is enabled),
because when getting the NSEI the index to argv is wrong and out of
bounds.

This patch fixes the offset.

Sponsored-by: On-Waves ehf
---
 src/gb/gprs_bssgp_vty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c
index 656c05e..88ae49f 100644
--- a/src/gb/gprs_bssgp_vty.c
+++ b/src/gb/gprs_bssgp_vty.c
@@ -135,7 +135,7 @@ DEFUN(show_bvc, show_bvc_cmd, "show bssgp nsei <0-65535> [stats]",
 	"The NSEI\n" "Include Statistics\n")
 {
 	struct bssgp_bvc_ctx *bvc;
-	uint16_t nsei = atoi(argv[1]);
+	uint16_t nsei = atoi(argv[0]);
 	int show_stats = 0;
 
 	if (argc >= 2)
-- 
1.9.1




More information about the OpenBSC mailing list