diff options
Diffstat (limited to 'src/firejail/ls.c')
-rw-r--r-- | src/firejail/ls.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/firejail/ls.c b/src/firejail/ls.c index 79e4b679b..601cab4f8 100644 --- a/src/firejail/ls.c +++ b/src/firejail/ls.c | |||
@@ -198,6 +198,10 @@ char *expand_path(const char *path) { | |||
198 | } | 198 | } |
199 | else { | 199 | else { |
200 | // assume the file is in current working directory | 200 | // assume the file is in current working directory |
201 | if (!cfg.cwd) { | ||
202 | fprintf(stderr, "Error: current working directory has been deleted\n"); | ||
203 | exit(1); | ||
204 | } | ||
201 | if (asprintf(&fname, "%s/%s", cfg.cwd, path) == -1) | 205 | if (asprintf(&fname, "%s/%s", cfg.cwd, path) == -1) |
202 | errExit("asprintf"); | 206 | errExit("asprintf"); |
203 | } | 207 | } |
@@ -206,6 +210,7 @@ char *expand_path(const char *path) { | |||
206 | 210 | ||
207 | void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) { | 211 | void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) { |
208 | EUID_ASSERT(); | 212 | EUID_ASSERT(); |
213 | assert(path1); | ||
209 | 214 | ||
210 | // if the pid is that of a firejail process, use the pid of the first child process | 215 | // if the pid is that of a firejail process, use the pid of the first child process |
211 | EUID_ROOT(); | 216 | EUID_ROOT(); |