Skip to content

Commit

Permalink
Fix: add missing returns in modify_config_run
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell authored and a-h-abdelsalam committed Sep 4, 2024
1 parent 94a354a commit 70794db
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

Check warning on line 1030 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1030

Added line #L1030 was not covered by tests
(XML_ERROR_SYNTAX ("modify_config",
"A config_id attribute is required"));
return;

Check warning on line 1033 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1033

Added line #L1033 was not covered by tests
}
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",

Check warning on line 1037 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1037

Added line #L1037 was not covered by tests
"Permission denied"));
return;

Check warning on line 1039 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1039

Added line #L1039 was not covered by tests
}

// 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;

Check warning on line 1062 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1062

Added line #L1062 was not covered by tests
}

// Handle basic attributes and elements
Expand Down

0 comments on commit 70794db

Please sign in to comment.