libbsc/bsc_vty.c: prevent uninitialized access

If an out of range 'Last Valid Block' value for 'smscb-command'
is passed, a 'last_block' of the 'rsl_ie_cb_cmd_type' struct
could be uninitialized. Let's prevent this.

Found using Clang Static Analyzer.

Change-Id: I57635f2f482ff476ab697b1b9e872ce90aafb999
This commit is contained in:
Vadim Yanitskiy 2018-03-06 17:18:25 +07:00
parent f7a6329bbd
commit 56dec0c753
1 changed files with 3 additions and 0 deletions

View File

@ -4258,6 +4258,9 @@ DEFUN(smscb_cmd, smscb_cmd_cmd,
case 4:
cb_cmd.last_block = RSL_CB_CMD_LASTBLOCK_4;
break;
default:
vty_out(vty, "Error parsing LASTBLOCK%s", VTY_NEWLINE);
return CMD_WARNING;
}
rsl_sms_cb_command(bts, RSL_CHAN_SDCCH4_ACCH, cb_cmd, buf, rc);