Skip to content

Commit

Permalink
Remove redundant override_id field
Browse files Browse the repository at this point in the history
Field is already available as get.id from get_data_parse_attributes.
  • Loading branch information
mattmundell committed Jul 31, 2024
1 parent 13a201b commit 36de6f1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,6 @@ get_nvt_families_data_reset (get_nvt_families_data_t *data)
typedef struct
{
get_data_t get; ///< Get args.
char *override_id; ///< ID of override to get.
char *nvt_oid; ///< OID of NVT to which to limit listing.
char *task_id; ///< ID of task to which to limit listing.
int result; ///< Boolean. Whether to include associated results.
Expand All @@ -1888,7 +1887,6 @@ typedef struct
static void
get_overrides_data_reset (get_overrides_data_t *data)
{
free (data->override_id);
free (data->nvt_oid);
free (data->task_id);

Expand Down Expand Up @@ -5429,9 +5427,6 @@ gmp_xml_handle_start_element (/* unused */ GMarkupParseContext* context,
attribute_names,
attribute_values);

append_attribute (attribute_names, attribute_values, "override_id",
&get_overrides_data->override_id);

append_attribute (attribute_names, attribute_values, "nvt_oid",
&get_overrides_data->nvt_oid);

Expand Down Expand Up @@ -14031,12 +14026,12 @@ handle_get_overrides (gmp_parser_t *gmp_parser, GError **error)
nvt_t nvt = 0;
task_t task = 0;

if (get_overrides_data->override_id && get_overrides_data->nvt_oid)
if (get_overrides_data->get.id && get_overrides_data->nvt_oid)
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("get_overrides",
"Only one of NVT and the override_id attribute"
" may be given"));
else if (get_overrides_data->override_id
else if (get_overrides_data->get.id

Check warning on line 14034 in src/gmp.c

View check run for this annotation

Codecov / codecov/patch

src/gmp.c#L14034

Added line #L14034 was not covered by tests
&& get_overrides_data->task_id)
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("get_overrides",
Expand Down

0 comments on commit 36de6f1

Please sign in to comment.