aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-03-06 17:18:25 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-03-06 17:18:25 +0700
commit56dec0c75358fe42954f9e7949ebd0c163377b10 (patch)
treedd3c72ef2543b43a266e7bee3a8c3c497d2b0136 /src
parentf7a6329bbd5dd621eccc10a05141b58f3b72ec06 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/libbsc/bsc_vty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 3dac29e05..47bc51483 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -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);