mirror of https://gerrit.osmocom.org/libosmocore
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:
parent
777be2e734
commit
cb5c4edda9
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue