From df68ee336565b37e42d6cd847d73b4ba9450c34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Nicola?= Date: Thu, 21 Nov 2024 15:06:15 +0100 Subject: [PATCH] Fix: notus result generation. (#1767) Add package name to the vulnerable version and fixed version. --- misc/table_driven_lsc.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/misc/table_driven_lsc.c b/misc/table_driven_lsc.c index 0c6e95cb0..97e9d8677 100644 --- a/misc/table_driven_lsc.c +++ b/misc/table_driven_lsc.c @@ -1051,22 +1051,25 @@ call_rs_notus (const char *ip_str, const char *hostname, const char *pkg_list, { g_string_printf (res, "\nVulnerable package: %s\n" - "Installed version: %s\n" - "Fixed version: <=%s\n" - "Fixed version: >=%s\n", - pkg->pkg_name, pkg->install_version, - pkg->range->start, pkg->range->stop); + "Installed version: %s-%s\n" + "Fixed version: <=%s-%s\n" + "Fixed version: >=%s-%s\n", + pkg->pkg_name, pkg->pkg_name, + pkg->install_version, pkg->pkg_name, + pkg->range->start, pkg->pkg_name, + pkg->range->stop); } else if (pkg->type == SINGLE) { int spec_len = 8 - (int) strlen (pkg->version->specifier); g_string_printf (res, "\nVulnerable package:%*s%s\n" - "Installed version:%*s%s\n" - "Fixed version:%*s%s%s\n", - 3, "", pkg->pkg_name, 4, "", + "Installed version:%*s%s-%s\n" + "Fixed version:%*s%s%s-%s\n", + 3, "", pkg->pkg_name, 4, "", pkg->pkg_name, pkg->install_version, spec_len, "", - pkg->version->specifier, pkg->version->version); + pkg->version->specifier, pkg->pkg_name, + pkg->version->version); } else {