Skip to content

Commit

Permalink
check for errors return status from extension table.
Browse files Browse the repository at this point in the history
  • Loading branch information
Agile86 committed Dec 9, 2019
1 parent 7922cd7 commit 5590218
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion osquery/sql/virtual_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,14 @@ static int xFilter(sqlite3_vtab_cursor* pVtabCursor,
PluginRequest request = {{"action", "generate"}};
TablePlugin::setRequestFromContext(context, request);
QueryData qd;
Registry::call("table", pVtab->content->name, request, qd);
auto status =
Registry::call("table", pVtab->content->name, request, qd);
if (!status.ok()) {
VLOG(1) << "Invalid response from the extension table. Error "
<< status.getCode() << ": " << status.getMessage();
setTableErrorMessage(pVtabCursor->pVtab, status.getMessage());
return SQLITE_ERROR;
}
pCur->rows = tableRowsFromQueryData(std::move(qd));
}

Expand Down

0 comments on commit 5590218

Please sign in to comment.