From ef92900e536e37f595048c06a747b7e91280ba9f Mon Sep 17 00:00:00 2001 From: Jaspar S Date: Fri, 25 Nov 2022 10:51:37 +0100 Subject: [PATCH] Change: Implement new check to find WID-SEC advisories in the xml (#1874) (cherry picked from commit cba05961d922164f8036d337cada5b600b3d3bdd) --- src/manage.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/manage.c b/src/manage.c index 35e3218d8..b4e80a47e 100644 --- a/src/manage.c +++ b/src/manage.c @@ -5336,7 +5336,8 @@ get_cve_filename (char *item_id) /** * @brief Compute the filename where a given CERT-Bund Advisory can be found. * - * @param[in] item_id CERT-Bund identifier without version ("CB-K??/????"). + * @param[in] item_id CERT-Bund identifier without version + ("CB-K??/????" or "WID-SEC-????-????") * * @return A dynamically allocated string (to be g_free'd) containing the * path to the desired file or NULL on error. @@ -5350,6 +5351,11 @@ get_cert_bund_adv_filename (char *item_id) { return g_strdup_printf (CERT_BUND_ADV_FILENAME_FMT, year); } + if (sscanf (item_id, "WID-SEC-%d-%*s", &year) == 1 ) + { + // new year format is YYYY thus subtract 2000 from the int + return g_strdup_printf (CERT_BUND_ADV_FILENAME_FMT, year - 2000); + } return NULL; }