From e0d84cab46912bdb113df0df3e84abaf5948dba7 Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Mon, 28 Oct 2019 09:43:49 +0100 Subject: [PATCH 1/2] Fix notes XML for lean reports The conditions for showing the notes in lean reports did not work as intended, so use the same technique as in buffer_result_overrides_xml. --- src/gmp.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gmp.c b/src/gmp.c index d8f36e2c6..3038c7c63 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -9928,6 +9928,8 @@ buffer_result_notes_xml (GString *buffer, result_t result, task_t task, { get_data_t get; iterator_t notes; + GString *temp_buffer; + memset (&get, '\0', sizeof (get)); /* Most recent first. */ get.filter = "sort-reverse=created owner=any permission=any"; @@ -9941,15 +9943,20 @@ buffer_result_notes_xml (GString *buffer, result_t result, task_t task, result, task); - if (lean == 0 || next (¬es)) - g_string_append (buffer, ""); - buffer_notes_xml (buffer, + temp_buffer = g_string_new (""); + buffer_notes_xml (temp_buffer, ¬es, include_notes_details, 0, NULL); - if (lean == 0 || next (¬es)) - g_string_append (buffer, ""); + + if (lean == 0 || strlen (temp_buffer->str)) + { + g_string_append (buffer, ""); + g_string_append (buffer, temp_buffer->str); + g_string_append (buffer, ""); + } + g_string_free (temp_buffer, TRUE); cleanup_iterator (¬es); } From 25fdb5d58beba69c1f22e0c79eb158eb088b8b96 Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Mon, 28 Oct 2019 09:50:07 +0100 Subject: [PATCH 2/2] Add notes fix to CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a6a509e7..cbc99cddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix preference ID in "Host Discovery" config [#828](https://github.com/greenbone/gvmd/pull/828) - Fix order of fingerprints in get_tls_certificates [#833](https://github.com/greenbone/gvmd/pull/833) - Update config preferences after updating NVTs [#832](https://github.com/greenbone/gvmd/pull/832) +- Fix notes XML for lean reports [#836](https://github.com/greenbone/gvmd/pull/836) ### Removed