intel / intel-ipsec-mb

Intel(R) Multi-Buffer Crypto for IPSec
BSD 3-Clause "New" or "Revised" License
288 stars 88 forks source link

hazardous use of memcpy on overlapping memory #109

Closed ColinIanKing closed 1 year ago

ColinIanKing commented 1 year ago

memcpy is being used with an overlapping copy operation, perhaps memmove() should be used instead.

static analysis with cppcheck throws the following warning:

lib/avx512_t1/zuc_top_avx512.c:759:25: error: Overlapping read/write in memcpy() is undefined behavior [overlappingWriteFunction] memcpy(keyStr32, &keyStr32[16], 64);

pablodelara commented 1 year ago

Thanks @ColinIanKing. I will take a look at this!

tkanteck commented 1 year ago

61490ba6f65c7e5efa172c2a41bb62c92102ff55 fixes the problem