Harald Welte has submitted this change and it was merged.

Change subject: libbsc/bsc_vty.c: prevent uninitialized access
......................................................................


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
---
M src/libbsc/bsc_vty.c
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 3dac29e..47bc514 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -4258,6 +4258,9 @@
        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);

-- 
To view, visit https://gerrit.osmocom.org/7123
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I57635f2f482ff476ab697b1b9e872ce90aafb999
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to