Skip to content
This repository was archived by the owner on Nov 29, 2021. It is now read-only.

Return an empty list in case of malformed host in the target list. - #341

Merged
ArnoStiefvater merged 3 commits into
greenbone:ospd-20.08from
jjnicola:bad-host
Nov 23, 2020
Merged

Return an empty list in case of malformed host in the target list.#341
ArnoStiefvater merged 3 commits into
greenbone:ospd-20.08from
jjnicola:bad-host

Conversation

@jjnicola

@jjnicola jjnicola commented Nov 20, 2020

Copy link
Copy Markdown
Member

What:
Return an empty list in case of malformed host in the target list.
This avoid OSPD to crash during calculation of the scan progress.
Now in conjunction with greenbone/openvas-scanner#625 the scan finishes with errors, but nicely.

Why:
OSPD check the length of the host list during the scan progress calculation. As the target is not empty, but with errors, the scan started but on error it had returned None, which caused ospd to crash.

How:
Start a scan with gvm-cli (gsa already checks for malformed target) wiht 192.168.0.1/32 as host target.

Checklist:

This avoid OSPD to crash during calculation of the scan progress.
@codecov

codecov Bot commented Nov 20, 2020

Copy link
Copy Markdown

Codecov Report

Merging #341 (ad14f79) into ospd-20.08 (982fdad) will increase coverage by 0.31%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff               @@
##           ospd-20.08     #341      +/-   ##
==============================================
+ Coverage       73.44%   73.75%   +0.31%     
==============================================
  Files              23       23              
  Lines            2576     2576              
==============================================
+ Hits             1892     1900       +8     
+ Misses            684      676       -8     
Impacted Files Coverage Δ
ospd/network.py 74.90% <100.00%> (+2.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 982fdad...ad14f79. Read the comment docs.

@jjnicola
jjnicola marked this pull request as ready for review November 20, 2020 14:08
@ArnoStiefvater
ArnoStiefvater merged commit 1867dfb into greenbone:ospd-20.08 Nov 23, 2020
@jjnicola
jjnicola deleted the bad-host branch November 23, 2020 11:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants