diff options
author | 2019-09-17 14:42:26 +0200 | |
---|---|---|
committer | 2019-09-17 14:42:26 +0200 | |
commit | 03374d40427740622b0c9cb66cda555fc443cd6d (patch) | |
tree | 01c90b5b5367ea889636f6a2792ff179130a728b /src | |
parent | add trace file validation (diff) | |
download | firejail-03374d40427740622b0c9cb66cda555fc443cd6d.tar.gz firejail-03374d40427740622b0c9cb66cda555fc443cd6d.tar.zst firejail-03374d40427740622b0c9cb66cda555fc443cd6d.zip |
fail gracefully if argc is zero
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index 900e61226..e8664e914 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -952,6 +952,12 @@ int main(int argc, char **argv) { | |||
952 | // sanitize the umask | 952 | // sanitize the umask |
953 | orig_umask = umask(022); | 953 | orig_umask = umask(022); |
954 | 954 | ||
955 | // argument count should be larger than 0 | ||
956 | if (argc == 0) { | ||
957 | fprintf(stderr, "Error: argv[0] is NULL\n"); | ||
958 | exit(1); | ||
959 | } | ||
960 | |||
955 | // check if the user is allowed to use firejail | 961 | // check if the user is allowed to use firejail |
956 | init_cfg(argc, argv); | 962 | init_cfg(argc, argv); |
957 | 963 | ||