diff options
-rw-r--r-- | src/firejail/util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/firejail/util.c b/src/firejail/util.c index 6b30ab5fe..f1c4f7059 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -1093,8 +1093,13 @@ unsigned extract_timeout(const char *str) { | |||
1093 | fprintf(stderr, "Error: invalid timeout, please use a hh:mm:ss format\n"); | 1093 | fprintf(stderr, "Error: invalid timeout, please use a hh:mm:ss format\n"); |
1094 | exit(1); | 1094 | exit(1); |
1095 | } | 1095 | } |
1096 | unsigned timeout = h * 3600 + m * 60 + s; | ||
1097 | if (timeout == 0) { | ||
1098 | fprintf(stderr, "Error: invalid timeout\n"); | ||
1099 | exit(1); | ||
1100 | } | ||
1096 | 1101 | ||
1097 | return h * 3600 + m * 60 + s; | 1102 | return timeout; |
1098 | } | 1103 | } |
1099 | 1104 | ||
1100 | void disable_file_or_dir(const char *fname) { | 1105 | void disable_file_or_dir(const char *fname) { |