Skip to content

Commit

Permalink
Do not add options without value
Browse files Browse the repository at this point in the history
We may run into problems on openvas side otherwise.
For example adding the empty string for the
ifaces_allow option would basically mean that we
do not allow any iface.
  • Loading branch information
ArnoStiefvater committed Jul 21, 2020
1 parent 3d3f94b commit 306fcd2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ospd_openvas/preferencehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ def prepare_scan_params_for_openvas(self, ospd_params: Dict[str, Dict]):
val = _from_bool_to_str(value)
else:
val = str(value)
# Do not add options which only have the empty string as value.
# We may run into problems on openvas side otherwise.
if val == '':
continue
prefs_val.append(key + "|||" + val)

self.kbdb.add_scan_preferences(self._openvas_scan_id, prefs_val)
Expand Down

0 comments on commit 306fcd2

Please sign in to comment.