check pw and pw_dir to be not null so that if either are null it bails to else block

This commit is contained in:
Jeff Becker 2020-06-16 10:09:38 -04:00
parent 2371e416bd
commit 63b56d55a9
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ namespace llarp
fs::path homedir;
auto pw = getpwuid(getuid());
if (pw)
if (pw and pw->pw_dir)
{
homedir = pw->pw_dir;
}