Merge pull request #13092 from keszybz/coverity-fixes

Coverity fixes
This commit is contained in:
Lennart Poettering
2019-07-17 14:18:49 +02:00
committed by GitHub
12 changed files with 96 additions and 89 deletions
+3 -7
View File
@@ -2092,13 +2092,9 @@ static int oci_hook_timeout(const char *name, JsonVariant *v, JsonDispatchFlags
uintmax_t k;
k = json_variant_unsigned(v);
if (k == 0)
return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL),
"Hook timeout cannot be zero.");
if (k > (UINT64_MAX-1/USEC_PER_SEC))
return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL),
"Hook timeout too large.");
if (k == 0 || k > (UINT64_MAX-1)/USEC_PER_SEC)
return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE),
"Hook timeout value out of range.");
*u = k * USEC_PER_SEC;
return 0;
+1 -1
View File
@@ -1282,7 +1282,7 @@ static int parse_argv(int argc, char *argv[]) {
case ARG_RLIMIT: {
const char *eq;
char *name;
_cleanup_free_ char *name = NULL;
int rl;
if (streq(optarg, "help")) {