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

Fix import of report results / errors without host (backport #1687) #1690

Merged
merged 3 commits into from
Sep 20, 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 @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Ensure gvmd sends error messages if gvmcg fails [#1682](https://github.com/greenbone/gvmd/pull/1682)
- Fix resume task. [#1679](https://github.com/greenbone/gvmd/pull/1679)
- Added a dedicated error message for the create ticket dialogue when the create permission permission is missing [#1686](https://github.com/greenbone/gvmd/pull/1686)
- Fix import of report results / errors without host [#1687](https://github.com/greenbone/gvmd/pull/1687)

[Unreleased]: https://github.com/greenbone/gvmd/compare/v21.4.3...HEAD

Expand Down
5 changes: 3 additions & 2 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -18331,8 +18331,9 @@ gmp_xml_handle_result ()
// https://www.freebsd.org/cgi/man.cgi?query=strcspn&sektion=3
// strcspn returns the number of chars spanned so it should be safe
// without double checking.
create_report_data
->result_host[strcspn (create_report_data->result_host, "\n")] = 0;
if (create_report_data->result_host)
create_report_data
->result_host[strcspn (create_report_data->result_host, "\n")] = 0;
result->host = create_report_data->result_host;
result->hostname = create_report_data->result_hostname;
result->nvt_oid = create_report_data->result_nvt_oid;
Expand Down