[PATCH] libosmocore[master]: ctrl_type_vals: fix range check

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Mar 2 14:52:34 UTC 2017


Review at  https://gerrit.osmocom.org/1963

ctrl_type_vals: fix range check

In ctrl_cmd_parse(), fix missing check for not parseable ctrl type.

Fixup for Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28.

Change-Id: I7f8055225e3ee04b2a723bae07b12c42618963a0
---
M src/ctrl/control_cmd.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/1963/1

diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c
index 1cc8247..cdec8ef 100644
--- a/src/ctrl/control_cmd.c
+++ b/src/ctrl/control_cmd.c
@@ -289,7 +289,7 @@
 	}
 
 	cmd->type = get_string_value(ctrl_type_vals, tmp);
-	if (cmd->type == CTRL_TYPE_UNKNOWN) {
+	if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) {
 		cmd->type = CTRL_TYPE_ERROR;
 		cmd->id = "err";
 		cmd->reply = "Request type unknown";

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f8055225e3ee04b2a723bae07b12c42618963a0
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list