Browse Source

fix order of tests to avoid strstr on NULL value

pull/2842/head
Gilles Depeyrot 3 years ago
committed by Max Lv
parent
commit
abcf85e983
1 changed files with 1 additions and 1 deletions
  1. 2
      src/manager.c

2
src/manager.c

@ -1123,7 +1123,7 @@ main(int argc, char **argv)
if (workdir == NULL || strlen(workdir) == 0) { if (workdir == NULL || strlen(workdir) == 0) {
workdir = pw->pw_dir; workdir = pw->pw_dir;
// If home dir is still not defined or set to nologin/nonexistent, fall back to /tmp // 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"; workdir = "/tmp";
} }

Loading…
Cancel
Save