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

Use params_value instead of params_value_bool for allow_simultaneous_ips #2813

Merged
merged 2 commits into from
Mar 23, 2021

Conversation

ArnoStiefvater
Copy link
Member

What:

Use params_value() instead of params_value_bool() for getting allow_simultaneous_ips.

Why:

Although the underlying value is bool we should not use params_value_bool for retrieving the value of reverse_lookup_only because it would break the mechanism of setting a default value for the setting.

params_value() returns a string ("0" or "1") if there is an value and NULL if not. params_value_bool() return 0 if the value is "0"
OR there is no value. This means that if we want to be able to set a default if there is no value (NULL) we need to use params_value() else the information is lost.

Fix crash.

How:

Created target with and without PR. Without PR gsad crashes.

Checklist:

Although the underlying value is bool we should
not use params_value_bool for retrieving the
value of allow_simultaneous_ips because it would
break the mechanism of setting a default value
for the setting.

params_value() returns a string ("0" or "1") if
there is an value and NULL if not.
params_value_bool() return 0 if the value is "0"
OR there is no value.
This means that if we want to be able to set a
default if there is no value (NULL) we need to use
params_value() else the information is lost.
@ArnoStiefvater ArnoStiefvater requested a review from a team March 23, 2021 13:25
Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault. Thanks for fixing it.

@bjoernricks bjoernricks enabled auto-merge March 23, 2021 13:30
@bjoernricks bjoernricks merged commit 7c0a701 into greenbone:gsa-21.04 Mar 23, 2021
bjoernricks added a commit that referenced this pull request Mar 24, 2021
Use params_value instead of params_value_bool for allow_simultaneous_ips (bp #2813)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants