]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix coverity-1610057
authorNeil Horman <nhorman@openssl.org>
Fri, 12 Jul 2024 18:34:01 +0000 (14:34 -0400)
committerTomas Mraz <tomas@openssl.org>
Thu, 18 Jul 2024 17:07:52 +0000 (19:07 +0200)
commit0b67643ade24286dddb0ce1b44a8a8c366e85ecb
tree775092da7be7ee32bb367372d5741d787c16ec89
parent863e44c1e0841b7c46f3fa1ddf75870c60105303
Fix coverity-1610057

Coverity caught a error in a recent change, in which atoi was used to
assign a value to two size_t variables, and then checked them for being
>= 0, which will always be true.

given that atoi returns an undefined value (usually zero) in the event
of a failure, theres no good way to check the return value of atoi for
validitiy.

Instead use OPENSSL_strtoul and confirm both that the translation
passed, and that the endptr value is at the NULL terminator (indicating
that the entire string was consumed)

Fixes openssl/private#552

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24861)
ssl/ssl_conf.c