diff --git a/CHANGELOG.md b/CHANGELOG.md index 2402b88f4..1a337e91c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Improve signal handling when update vhosts list. [#425](https://github.com/greenbone/openvas/pull/425) - Wait for all children instead of waiting just for one a time. [#428](https://github.com/greenbone/openvas/pull/428) - Don't detect MongoDB as a HTTP service. [#447](https://github.com/greenbone/openvas/pull/447) +- Set status finished and send a message if the port list is invalid. [#453](https://github.com/greenbone/openvas/pull/453) [Unreleased]: https://github.com/greenbone/openvas/compare/openvas-7.0...master diff --git a/src/attack.c b/src/attack.c index f2af822f7..a19209b2c 100644 --- a/src/attack.c +++ b/src/attack.c @@ -1074,6 +1074,17 @@ attack_network (struct scan_globals *globals, kb_t *network_kb) port_range = prefs_get ("port_range"); if (validate_port_range (port_range)) { + kb_t main_kb = NULL; + + connect_main_kb (&main_kb); + error_message_to_client2 ( + main_kb, "Invalid port list. Ports must be in the range [1-65535]", + NULL); + kb_lnk_reset (main_kb); + g_warning ("Invalid port list. Ports must be in the range [1-65535]. " + "Scan terminated."); + set_scan_status ("finished"); + return; }