diff --git a/CHANGELOG.md b/CHANGELOG.md index d9f9497e2..b9ac82d40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - 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 diff --git a/src/gmp.c b/src/gmp.c index c1da7f7d8..663a650db 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -18169,8 +18169,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;