laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/35868?usp=email )

Change subject: mobile: assert() values returned by get_string_value()
......................................................................

mobile: assert() values returned by get_string_value()

Change-Id: I58bc31a4c3d952f71ed2c53b65bb30538172ca4e
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 15 insertions(+), 1 deletion(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index a4da22a..87c8045 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -2721,6 +2721,8 @@
        struct osmocom_ms *ms = (struct osmocom_ms *)vty->index;
        int val = get_string_value(tch_voice_io_handler_names, argv[0]);

+       OSMO_ASSERT(val >= 0);
+
        if (val == TCH_VOICE_IOH_MNCC_SOCK) {
                if (ms->settings.mncc_handler != MNCC_HANDLER_INTERNAL) {
                        vty_out(vty, "TCH voice I/O handler 'mncc-sock' can 
only be used "
@@ -2755,12 +2757,13 @@
        struct osmocom_ms *ms = (struct osmocom_ms *)vty->index;
        struct gsm_settings *set = &ms->settings;

+       OSMO_ASSERT(val >= 0);
+
        if (set->tch_voice.io_handler != TCH_VOICE_IOH_GAPK) {
                vty_out(vty, "This parameter is only valid for GAPK%s", 
VTY_NEWLINE);
                return CMD_WARNING;
        }

-       OSMO_ASSERT(val >= 0);
        set->tch_voice.io_format = val;

        return CMD_SUCCESS;
@@ -2828,6 +2831,8 @@
 {
        int val = get_string_value(tch_data_io_handler_names, argv[0]);

+       OSMO_ASSERT(val >= 0);
+
        return set_tch_data_io_handler(vty, val);
 }


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35868?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I58bc31a4c3d952f71ed2c53b65bb30538172ca4e
Gerrit-Change-Number: 35868
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to