Skip to content

Commit

Permalink
Explicitly handle when getUserHomeDir returns empty
Browse files Browse the repository at this point in the history
  • Loading branch information
offlinemark committed Aug 8, 2019
1 parent 59a68ad commit b2199dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osquery/tables/system/windows/certificates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,11 @@ void findUserPersonalCertsOnDisk(const std::string& username,

std::string homeDir;
auto homeDirUnexpanded = getUserHomeDir(sid);
if (homeDirUnexpanded.empty()) {
VLOG(1) << "Could not find home dir for account " << username;
return;
}

// System accounts have environment variables in their paths
auto ret = expandEnvironmentVariables(homeDirUnexpanded, homeDir);
if (!ret.ok() || homeDir.empty()) {
Expand Down

0 comments on commit b2199dd

Please sign in to comment.