From d921f62866188bbe62b5f752b21f939bb196cbb9 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Thu, 18 Jun 2020 15:03:21 +0200 Subject: [PATCH 1/3] Fix openvas-nasl. Add kb key/value for all vhosts --- nasl/nasl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nasl/nasl.c b/nasl/nasl.c index 8dfa2bda5..6bb093b78 100644 --- a/nasl/nasl.c +++ b/nasl/nasl.c @@ -383,16 +383,17 @@ main (int argc, char **argv) } if (kb_values) { - while (*kb_values) + gchar **kb_values_aux = kb_values; + while (*kb_values_aux) { - gchar **splits = g_strsplit (*kb_values, "=", -1); + gchar **splits = g_strsplit (*kb_values_aux, "=", -1); if (splits[2] || !splits[1]) { - fprintf (stderr, "Erroneous --kb entry %s\n", *kb_values); + fprintf (stderr, "Erroneous --kb entry %s\n", *kb_values_aux); exit (1); } kb_item_add_str_unique (kb, splits[0], splits[1], 0); - kb_values++; + kb_values_aux++; g_strfreev (splits); } } From 4b086e69c8574481fa83023a94567fe50debc4c1 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Thu, 18 Jun 2020 15:05:13 +0200 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab22f120e..d88c184b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Prevent child deadlock. [#491](https://github.com/greenbone/openvas/pull/491) - Memleak fixes for kb_item_get_str(). [#502](https://github.com/greenbone/openvas/pull/502) - Fix denied hosts. [#510](https://github.com/greenbone/openvas/pull/510) +- Fix openvas-nasl. Add kb key/value for all vhosts. [#533](https://github.com/greenbone/openvas/pull/533) ### Removed - Removed "network scan" mode. This includes removal of NASL API methods "scan_phase()" and "network_targets()". Sending a "network_mode=yes" in a scanner configuration will have no effect anymore. [#493](https://github.com/greenbone/openvas/pull/493) From 6269c33b94da49cfc52212d0bf57238ee623ba87 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Thu, 18 Jun 2020 15:27:06 +0200 Subject: [PATCH 3/3] Fix format --- nasl/nasl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nasl/nasl.c b/nasl/nasl.c index 6bb093b78..2f2580375 100644 --- a/nasl/nasl.c +++ b/nasl/nasl.c @@ -389,7 +389,8 @@ main (int argc, char **argv) gchar **splits = g_strsplit (*kb_values_aux, "=", -1); if (splits[2] || !splits[1]) { - fprintf (stderr, "Erroneous --kb entry %s\n", *kb_values_aux); + fprintf (stderr, "Erroneous --kb entry %s\n", + *kb_values_aux); exit (1); } kb_item_add_str_unique (kb, splits[0], splits[1], 0);