2
0
mirror of https://github.com/boostorg/uuid.git synced 2026-01-19 04:42:16 +00:00

Avoid UBSan failures in md5.hpp

This commit is contained in:
Peter Dimov
2024-04-22 13:18:29 +03:00
parent db01591b1c
commit e2a66aaf73

View File

@@ -116,9 +116,9 @@ private:
*/
#if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
#define BOOST_UUID_DETAIL_MD5_SET(n) \
(*(MD5_u32plus *)&ptr[(n) * 4])
(memcpy(&ctx->block[(n)], &ptr[(n) * 4], sizeof(MD5_u32plus)), (ctx->block[(n)]))
#define BOOST_UUID_DETAIL_MD5_GET(n) \
BOOST_UUID_DETAIL_MD5_SET(n)
(ctx->block[(n)])
#else
#define BOOST_UUID_DETAIL_MD5_SET(n) \
(ctx->block[(n)] = \