Skip to content

Commit ea93a6c

Browse files
committed
Fix: Improve handling of unknown scan ids
Don't print a traceback if a scan_id is not available. Instead safely handle this case and log a warning. (cherry picked from commit 51d84e0)
1 parent 26781d7 commit ea93a6c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ospd_openvas/daemon.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,12 @@ def report_results(self, results: list, scan_id: str) -> bool:
850850
with following fields: result_type, host_ip, host_name, port, oid,
851851
value, uri (optional)
852852
853+
Returns:
854+
True if the results have been reported
853855
"""
856+
if not self.scan_collection.id_exists(scan_id):
857+
logger.warning("Unknown scan_id %s", scan_id)
858+
return False
854859

855860
vthelper = VtHelper(self.nvti)
856861

0 commit comments

Comments
 (0)