ctrl_type_vals: fix range check

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

Fixup for Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28.

Change-Id: I7f8055225e3ee04b2a723bae07b12c42618963a0
This commit is contained in:
Neels Hofmeyr 2017-03-02 14:32:52 +01:00
parent 777be2e734
commit cb5c4edda9
1 changed files with 1 additions and 1 deletions

View File

@ -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";