Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send the hosts count to the client as -1, because the invalid target list #646

Merged
merged 1 commit into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. Set 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
9 changes: 8 additions & 1 deletion src/attack.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
* process bar.
*/
#define PROGRESS_BAR_STYLE 1
/**
* Define value to be sent to the client for invalid target list.
**/
#define INVALID_TARGET_LIST "-1"

#undef G_LOG_DOMAIN
/**
Expand Down Expand Up @@ -1082,9 +1086,12 @@ 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, INVALID_TARGET_LIST, NULL, NULL,
"HOSTS_COUNT");
kb_lnk_reset (main_kb);
g_warning ("Invalid target list. Scan terminated.");
set_scan_status ("finished");
goto stop;
}

Expand Down