From dd95854ea243acd0554621fd12e4b60c9c8ba9eb Mon Sep 17 00:00:00 2001 From: Mo Yi Date: Mon, 25 Mar 2024 20:01:48 +0800 Subject: [PATCH] Fix misaligned address asan (#71) --- src/streamvbytedelta_x64_encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/streamvbytedelta_x64_encode.c b/src/streamvbytedelta_x64_encode.c index 543bbc5..6daa253 100644 --- a/src/streamvbytedelta_x64_encode.c +++ b/src/streamvbytedelta_x64_encode.c @@ -66,7 +66,7 @@ static size_t streamvbyte_encode_SSE41_d1_init (const uint32_t* in, uint32_t cou uint32_t dw = in[i] - prev; prev = in[i]; uint32_t symbol = (dw > 0x000000FF) + (dw > 0x0000FFFF) + (dw > 0x00FFFFFF); key |= symbol << (i + i); - *((uint32_t*)dataPtr) = dw; + memcpy(dataPtr, &dw, 4); dataPtr += 1 + symbol; } memcpy(keyPtr, &key, ((count & 7) + 3) >> 2);