]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a potential misaligned memory access
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 2 Jan 2025 15:17:46 +0000 (16:17 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 6 Jan 2025 19:46:08 +0000 (20:46 +0100)
in test/wpackettest.c:593:18: runtime error: load of misaligned address
for type 'uint64_t', which requires 8 byte alignment.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26269)

test/wpackettest.c

index 1284d7a0ce209e2acc3cfe09d6678ea02896c59c..8e5eb8d4cf472e288e25d64461264f6f394ac78e 100644 (file)
@@ -590,7 +590,7 @@ static int test_WPACKET_quic_vlint_random(void)
         if (!TEST_int_gt(RAND_bytes(rand_data, sizeof(rand_data)), 0))
             return cleanup(&pkt);
 
-        expected = *(uint64_t*)rand_data;
+        memcpy(&expected, rand_data, sizeof(uint64_t));
 
         /*
          * Ensure that all size classes get tested with equal probability.