From: Neil Horman Date: Wed, 31 Dec 2025 14:19:42 +0000 (-0500) Subject: Fix dead code/constant expression in simdutf test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf8b11c18482c58b2d73dbc189654e18d4e336c5;p=thirdparty%2Fopenssl.git Fix dead code/constant expression in simdutf test Coverity issues: https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=1677828 and https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=1677827 caught some dead code in the simdutf test. The total variable is defined as an int, which is tested against <= INT_MAX, and > INT_MAX, which will always be true, and false respectively, making the <= test needless, and the condition the latter bounds dead code Clean that up. Reviewed-by: Saša Nedvědický Reviewed-by: Nikola Pajkovsky (Merged from https://github.com/openssl/openssl/pull/29525) --- diff --git a/test/test_base64_simdutf.c b/test/test_base64_simdutf.c index 74cbab240a0..65c3b747ff1 100644 --- a/test/test_base64_simdutf.c +++ b/test/test_base64_simdutf.c @@ -121,7 +121,7 @@ static int evp_encodeupdate_old(EVP_ENCODE_CTX *ctx, unsigned char *out, int *ou } *out = '\0'; } - while (inl >= ctx->length && total <= INT_MAX) { + while (inl >= ctx->length) { j = evp_encodeblock_int_old(ctx, out, in, ctx->length); in += ctx->length; inl -= ctx->length; @@ -133,11 +133,6 @@ static int evp_encodeupdate_old(EVP_ENCODE_CTX *ctx, unsigned char *out, int *ou } *out = '\0'; } - if (total > INT_MAX) { - /* Too much output data! */ - *outl = 0; - return 0; - } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl;