Skip to content

Commit

Permalink
fix order of tests to avoid strstr on NULL value
Browse files Browse the repository at this point in the history
  • Loading branch information
gdepeyrot authored and Max Lv committed Jul 16, 2021
1 parent 0a7d178 commit abcf85e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ main(int argc, char **argv)
if (workdir == NULL || strlen(workdir) == 0) {
workdir = pw->pw_dir;
// If home dir is still not defined or set to nologin/nonexistent, fall back to /tmp
if (strstr(workdir, "nologin") || strstr(workdir, "nonexistent") || workdir == NULL || strlen(workdir) == 0) {
if (workdir == NULL || strlen(workdir) == 0 || strstr(workdir, "nologin") || strstr(workdir, "nonexistent")) {
workdir = "/tmp";
}

Expand Down

0 comments on commit abcf85e

Please sign in to comment.