Skip to content

Commit

Permalink
Send the hosts count to the client as -1, because the invalid target …
Browse files Browse the repository at this point in the history
…list

This allows ospd to finish the scan gracefully, setting the scan to finished
instead of interrupted, but sending the error message as well.
  • Loading branch information
jjnicola committed Jan 29, 2021
1 parent 5a9c491 commit 8fca582
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix snmp result. Only return the value and do not stop at the first \n. [#627](https://github.com/greenbone/openvas/pull/627)
- Fix masking of IPv6 addresses. [#635](https://github.com/greenbone/openvas/pull/635)
- Fix technique switch for getting the appropriate interface to use for IPv6 dst addr. [#636](https://github.com/greenbone/openvas/pull/636)
- Fix host count setting to -1 when the target string is invalid. [#646](https://github.com/greenbone/openvas/pull/646)

[20.08]: https://github.com/greenbone/openvas/compare/v20.8.0...openvas-20.08

Expand Down
4 changes: 3 additions & 1 deletion src/attack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,11 @@ attack_network (struct scan_globals *globals)
connect_main_kb (&main_kb);
message_to_client (main_kb, buffer, NULL, NULL, "ERRMSG");
g_free (buffer);
/* Send the hosts count to the client as -1,
* because the invalid target list.*/
message_to_client (main_kb, "-1", NULL, NULL, "HOSTS_COUNT");
kb_lnk_reset (main_kb);
g_warning ("Invalid target list. Scan terminated.");
set_scan_status ("finished");
goto stop;
}

Expand Down

0 comments on commit 8fca582

Please sign in to comment.