Skip to content

Commit

Permalink
Merge pull request #2243 from greenbone/modify-config-missing-returns
Browse files Browse the repository at this point in the history
Fix: add missing returns in modify_config_run
  • Loading branch information
a-h-abdelsalam authored Sep 4, 2024
2 parents 94a354a + 70794db commit 1a59461
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/gmp_configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,12 +1026,18 @@ modify_config_run (gmp_parser_t *gmp_parser, GError **error)
config_id = attr_or_null (entity, "config_id");

if (config_id == NULL)
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("modify_config",
"A config_id attribute is required"));
{
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("modify_config",
"A config_id attribute is required"));
return;
}
else if (config_predefined_uuid (config_id))
SEND_TO_CLIENT_OR_FAIL (XML_ERROR_SYNTAX ("modify_config",
"Permission denied"));
{
SEND_TO_CLIENT_OR_FAIL (XML_ERROR_SYNTAX ("modify_config",
"Permission denied"));
return;
}

// Find the config
switch (manage_modify_config_start (config_id, &config))
Expand All @@ -1053,6 +1059,7 @@ modify_config_run (gmp_parser_t *gmp_parser, GError **error)
SEND_TO_CLIENT_OR_FAIL
(XML_INTERNAL_ERROR ("modify_config"));
log_event_fail ("config", "Scan Config", config_id, "modified");
return;
}

// Handle basic attributes and elements
Expand Down

0 comments on commit 1a59461

Please sign in to comment.