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

Fix filter out of default 'radio' type preferences #560

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix name of NASL internal IPPROTO_IP variable. [#552](https://github.com/greenbone/openvas/pull/552)
- Fix byte ordering and wrong PROTO identifier in dump_ipv6_packet() for openvas-nasl. [#549](https://github.com/greenbone/openvas/pull/549)
- Fix size calculation which lead to alloc error in get_tcp_element() of openvas-nasl. [#546](https://github.com/greenbone/openvas/pull/546)
- Fix filter out of default 'radio' type preferences [#560](https://github.com/greenbone/openvas/pull/560)

### Removed
- Removed "network scan" mode. This includes removal of NASL API methods "scan_phase()" and "network_targets()". Sending a "network_mode=yes" in a scanner configuration will have no effect anymore. [#493](https://github.com/greenbone/openvas/pull/493)
Expand Down
12 changes: 11 additions & 1 deletion misc/plugutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,17 @@ get_plugin_preference (const char *oid, const char *name, int pref_id)
if ((cname && !strcmp (cname, nvtpref_name (tmp->data)))
|| (pref_id >= 0 && pref_id == nvtpref_id (tmp->data)))
{
retval = g_strdup (nvtpref_default (tmp->data));
if (!strcmp (nvtpref_type (tmp->data), "radio"))
{
char **opts =
g_strsplit (nvtpref_default (tmp->data), ";", -1);

retval = g_strdup (opts[0]);
g_strfreev (opts);
}
else
retval = g_strdup (nvtpref_default (tmp->data));

break;
}
tmp = tmp->next;
Expand Down