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) diff --git a/nasl/nasl.c b/nasl/nasl.c index 8dfa2bda5..2f2580375 100644 --- a/nasl/nasl.c +++ b/nasl/nasl.c @@ -383,16 +383,18 @@ 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); } }