BSC VTY: Fix off-by-one / segfault in 'show bts NR'

This commit is contained in:
Harald Welte 2010-12-24 12:24:03 +01:00
parent 85bded8b50
commit 712ddbcd72
1 changed files with 1 additions and 1 deletions

View File

@ -269,7 +269,7 @@ DEFUN(show_bts, show_bts_cmd, "show bts [number]",
if (argc != 0) {
/* use the BTS number that the user has specified */
bts_nr = atoi(argv[0]);
if (bts_nr > net->num_bts) {
if (bts_nr >= net->num_bts) {
vty_out(vty, "%% can't find BTS '%s'%s", argv[0],
VTY_NEWLINE);
return CMD_WARNING;