Skip to content

Commit

Permalink
Merge pull request #215 from kroosec/plug-get-key
Browse files Browse the repository at this point in the history
plug_get_key() should get one value in single case.
  • Loading branch information
jjnicola authored Nov 29, 2018
2 parents 6d965a2 + a8d4020 commit 8c08d81
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions misc/plugutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,12 +865,15 @@ plug_get_key (struct script_infos *args, char *name, int *type, size_t *len,
if (kb == NULL)
return NULL;

res = kb_item_get_all (kb, name);
if (single)
res = kb_item_get_single (kb, name, KB_TYPE_UNSPEC);
else
res = kb_item_get_all (kb, name);

if (res == NULL)
return NULL;

if (res->next == NULL || single) /* No fork - good */
if (!res->next) /* No fork - good */
{
void *ret;
if (res->type == KB_TYPE_INT)
Expand Down

0 comments on commit 8c08d81

Please sign in to comment.