Skip to content

Commit

Permalink
Merge pull request #607 from jjnicola/wmi-fix
Browse files Browse the repository at this point in the history
Fix wmi query when there is no error but empty answer.
  • Loading branch information
jjnicola authored Oct 13, 2020
2 parents 6359774 + f79c163 commit af847eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Send message to the client with hosts count. [#606](https://github.com/greenbone/openvas/pull/606)

### Changed
- Downgrade wmi queries log level for common errors. [#602](https://github.com/greenbone/openvas/pull/602)
- Downgrade wmi queries log level for common errors.
[#602](https://github.com/greenbone/openvas/pull/602)
[#607](https://github.com/greenbone/openvas/pull/607)

### Fixed
- Fork vhosts before creating the socket.[#576](https://github.com/greenbone/openvas/pull/576)
Expand Down
5 changes: 5 additions & 0 deletions nasl/nasl_wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ nasl_wmi_query (lex_ctxt *lexic)
g_debug ("wmi_query: WMI query failed '%s'", query);
return NULL;
}
else if (res == NULL)
return NULL;

retc->x.str_val = strdup (res);
retc->size = strlen (res);
Expand Down Expand Up @@ -364,6 +366,9 @@ nasl_wmi_query_rsop (lex_ctxt *lexic)
g_debug ("wmi_query_rsop: WMI query failed");
return NULL;
}
else if (res == NULL)
return NULL;

retc->x.str_val = strdup (res);
retc->size = strlen (res);

Expand Down

0 comments on commit af847eb

Please sign in to comment.