Skip to content

Commit

Permalink
Only explode registry key if it can be tokenized
Browse files Browse the repository at this point in the history
  • Loading branch information
Breakwell committed Jun 1, 2020
1 parent c34bdf6 commit cb2b9b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions osquery/tables/system/windows/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,11 @@ inline void explodeRegistryPath(const std::string& path,
std::string& rHive,
std::string& rKey) {
auto toks = osquery::split(path, kRegSep);
rHive = toks.front();
toks.erase(toks.begin());
rKey = osquery::join(toks, kRegSep);
if (toks.size()) {
rHive = toks.front();
toks.erase(toks.begin());
rKey = osquery::join(toks, kRegSep);
}
}

/// Microsoft helper function for getting the contents of a registry key
Expand Down

0 comments on commit cb2b9b1

Please sign in to comment.