]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/mem_alloc_test.c: tfix in test_xaligned_alloc
authorEugene Syromiatnikov <esyr@openssl.org>
Tue, 12 Aug 2025 08:08:19 +0000 (10:08 +0200)
committerNeil Horman <nhorman@openssl.org>
Tue, 19 Aug 2025 18:47:54 +0000 (14:47 -0400)
Change "=" to "==" in "if ((exp == EXP_NONNULL) ...".

Fixes: d090695101a9 "test: add a sanity test for memory allocation functions"
Resolves: https://scan5.scan.coverity.com/#/project-view/65279/10222?selectedIssue=1662047
Resolves: https://scan5.scan.coverity.com/#/project-view/65279/10222?selectedIssue=1662049
Related: https://github.com/openssl/project/issues/1317
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28238)

test/mem_alloc_test.c

index 899f49d2d47b07914d5bf6724e30537c300e1acc..0f305d27440ff7c9b531442c5c50ade453b442fd 100644 (file)
@@ -698,7 +698,7 @@ static int test_xaligned_alloc(const bool array, const bool macro,
 #if !defined(OPENSSL_SMALL_FOOTPRINT)
     if (IS_FAIL(exp) && !TEST_ptr_null(freeptr))
         res = 0;
-    if ((exp = EXP_NONNULL) && !TEST_ptr(freeptr))
+    if ((exp == EXP_NONNULL) && !TEST_ptr(freeptr))
         res = 0;
 #else /* OPENSSL_SMALL_FOOTPRINT */
     if (!TEST_ptr_null(ret) || !TEST_ptr_null(freeptr))