]> git.ipfire.org Git - thirdparty/openssl.git/commit
test/bio_comp_test.c: Initialize pointer to avoid undefined behavior
authorJiashengJiang <jiasheng@purdue.edu>
Mon, 5 May 2025 18:23:38 +0000 (14:23 -0400)
committerTomas Mraz <tomas@openssl.org>
Thu, 8 May 2025 11:48:51 +0000 (13:48 +0200)
commit2e7020b4e9fdd55b824a69bdaecc6c90c7ea56ac
treed69309960c793746be887af5e66d4538f8fd4e7d
parent00331d81678661f99e09c2df74d67b37162b91fd
test/bio_comp_test.c: Initialize pointer to avoid undefined behavior

If the allocation for "original" fails, "result" may be freed without being
properly initialized. Since result could hold a random value due to its
assignment in do_bio_comp_test(), freeing it without initialization is unsafe
and may lead to undefined behavior.

Fixes: 12e96a2360 ("Add brotli compression support (RFC7924)")
Signed-off-by: JiashengJiang <jiasheng@purdue.edu>
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/27569)

(cherry picked from commit 4dca928a29cbe413f2416ac5e1ba2fe4e073f608)
test/bio_comp_test.c