summaryrefslogtreecommitdiffstats
path: root/apps/lib
diff options
context:
space:
mode:
authorNeil Horman <nhorman@openssl.org>2024-07-15 21:59:14 +0200
committerTomas Mraz <tomas@openssl.org>2024-07-17 09:50:36 +0200
commita753547eefc9739f341824a0cb0642afe7a06fcc (patch)
treea94be42729a2ab850d8f372349e857b25a986fde /apps/lib
parentUnit test for switching from KMAC to other MAC in kbkdf. (diff)
downloadopenssl-a753547eefc9739f341824a0cb0642afe7a06fcc.tar.xz
openssl-a753547eefc9739f341824a0cb0642afe7a06fcc.zip
Fix coverity-1604665
Coverity issued an error in the opt_uintmax code, detecting a potential overflow on a cast to ossl_intmax_t Looks like it was just a typo, casting m from uintmax_t to ossl_intmax_t Fix it by correcting the cast to be ossl_uintmax_t, as would be expected Theres also some conditionals that seem like they should be removed, but I'll save that for later, as there may be some corner cases in which ossl_uintmax_t isn't equal in size to uintmax_t..maybe. Fixes openssl/private#567 Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24897)
Diffstat (limited to 'apps/lib')
-rw-r--r--apps/lib/opt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/lib/opt.c b/apps/lib/opt.c
index 0490c39c25..d72b624a9e 100644
--- a/apps/lib/opt.c
+++ b/apps/lib/opt.c
@@ -646,7 +646,7 @@ int opt_uintmax(const char *value, ossl_uintmax_t *result)
opt_number_error(value);
return 0;
}
- *result = (ossl_intmax_t)m;
+ *result = (ossl_uintmax_t)m;
errno = oerrno;
return 1;
}