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:
Holger Hans Peter Freyther 2015-04-07 09:08:32 +02:00
parent 42d67a840d
commit 91acba34a9
1 changed files with 8 additions and 1 deletions

View File

@ -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)
{
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;
const char *value = cmd->value;
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);
if (!entry) {
cmd->reply = "OOM";