Skip to content

Commit

Permalink
Send cvss_base instead of severity when lean
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell authored and timopollmeier committed Oct 26, 2023
1 parent 9d4cbf6 commit 27d1bb4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -5834,7 +5834,6 @@ get_nvt_xml (iterator_t *nvts, int details, int pref_count,
"<modification_time>%s</modification_time>"
"<category>%d</category>"
"<family>%s</family>"
"<cvss_base>%s</cvss_base>"
"<qod>"
"<value>%s</value>"
"<type>%s</type>"
Expand All @@ -5850,9 +5849,6 @@ get_nvt_xml (iterator_t *nvts, int details, int pref_count,
: "",
nvt_iterator_category (nvts),
family_text,
nvt_iterator_cvss_base (nvts)
? nvt_iterator_cvss_base (nvts)
: "",
nvt_iterator_qod (nvts),
nvt_iterator_qod_type (nvts),
refs_str->str,
Expand All @@ -5861,7 +5857,7 @@ get_nvt_xml (iterator_t *nvts, int details, int pref_count,
}

g_string_append_printf (buffer,
"<severities score=\"%s\">",
"<cvss_base>%s</cvss_base>",
nvt_iterator_cvss_base (nvts)
? nvt_iterator_cvss_base (nvts)
: "");
Expand All @@ -5870,6 +5866,12 @@ get_nvt_xml (iterator_t *nvts, int details, int pref_count,
{
iterator_t severities;

g_string_append_printf (buffer,
"<severities score=\"%s\">",
nvt_iterator_cvss_base (nvts)
? nvt_iterator_cvss_base (nvts)
: "");

init_nvt_severity_iterator (&severities, oid);
while (next (&severities))
{
Expand All @@ -5888,10 +5890,10 @@ get_nvt_xml (iterator_t *nvts, int details, int pref_count,
nvt_severity_iterator_value (&severities));
}
cleanup_iterator (&severities);
}

g_string_append_printf (buffer,
"</severities>");
g_string_append_printf (buffer,
"</severities>");
}

g_free (family_text);
g_string_free (nvt_tags, 1);
Expand Down

0 comments on commit 27d1bb4

Please sign in to comment.