]> git.ipfire.org Git - thirdparty/openssl.git/commit
ssl/ssl_lib.c: Add the check before cast from int to unsigned
authorJiasheng Jiang <jiasheng@purdue.edu>
Fri, 22 Mar 2024 16:26:44 +0000 (16:26 +0000)
committerNeil Horman <nhorman@openssl.org>
Tue, 2 Apr 2024 14:31:10 +0000 (10:31 -0400)
commit165797c7d829aa699f5cfdea4969cad0916e8cdf
tree8d612c3df370d8b4489df073ceca1a47354890c0
parentde85587911dcd41dc3546b348acf9c9f15dd7c3d
ssl/ssl_lib.c: Add the check before cast from int to unsigned

Add the check before cast from int to unsigned to avoid integer overflow since EVP_MD_get_size() may return negative numbers.

Fixes: 919ba00942 ("DANE support structures, constructructors and accessors")
Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/23940)
ssl/ssl_lib.c