nat: Check for the access list in set command as well
I omitted the check as this was already done by the verify function for this command. Please Coverity and do the check again even if it is not necessary. I begin to doubt the usage of a "dedicated" verify method as well. Silences: Coverity CID 1293150
This commit is contained in:
parent
42d67a840d
commit
91acba34a9
|
@ -404,11 +404,18 @@ static int get_net_cfg_acc_cmd(struct ctrl_cmd *cmd, void *data)
|
||||||
static int set_net_cfg_acc_cmd(struct ctrl_cmd *cmd, void *data)
|
static int set_net_cfg_acc_cmd(struct ctrl_cmd *cmd, void *data)
|
||||||
{
|
{
|
||||||
const char *access_name = extract_acc_name(cmd->variable);
|
const char *access_name = extract_acc_name(cmd->variable);
|
||||||
struct bsc_nat_acc_lst *acc = bsc_nat_acc_lst_find(g_nat, access_name);
|
struct bsc_nat_acc_lst *acc;
|
||||||
struct bsc_nat_acc_lst_entry *entry;
|
struct bsc_nat_acc_lst_entry *entry;
|
||||||
const char *value = cmd->value;
|
const char *value = cmd->value;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
/* Should have been caught by verify_net_cfg_acc_cmd */
|
||||||
|
acc = bsc_nat_acc_lst_find(g_nat, access_name);
|
||||||
|
if (!acc) {
|
||||||
|
cmd->reply = "Access list not found";
|
||||||
|
return CTRL_CMD_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
entry = bsc_nat_acc_lst_entry_create(acc);
|
entry = bsc_nat_acc_lst_entry_create(acc);
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
cmd->reply = "OOM";
|
cmd->reply = "OOM";
|
||||||
|
|
Loading…
Reference in New Issue