summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-02 14:32:52 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-06 14:35:54 +0000
commitcb5c4edda910059afd8dad26bafbc2ddb5e877fb (patch)
tree75c89b968d2965033e3193d12d7c40c5bb7aedac
parent777be2e734b95ab9982a20c22f134d004a78c961 (diff)
ctrl_type_vals: fix range check
In ctrl_cmd_parse(), fix missing check for not parseable ctrl type. Fixup for Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28. Change-Id: I7f8055225e3ee04b2a723bae07b12c42618963a0
-rw-r--r--src/ctrl/control_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c
index 1cc8247b..cdec8efb 100644
--- a/src/ctrl/control_cmd.c
+++ b/src/ctrl/control_cmd.c
@@ -289,7 +289,7 @@ struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg)
}
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";