Enable building ffsparser_fuzzer during CI/CD, improve readUnaligned to silence Clang UBSAN

This commit is contained in:
Nikolaj Schlej 2025-02-14 07:46:55 +01:00
parent ff42cecb07
commit 369f10188c
2 changed files with 30 additions and 2 deletions

View file

@ -70,7 +70,7 @@ INTN findPattern(const UINT8 *pattern, const UINT8 *patternMask, UINTN patternSi
template <typename T>
inline T readUnaligned(const T *v) {
T tmp = {};
memcpy(&tmp, v, sizeof(T));
memcpy(reinterpret_cast<void*>(&tmp), reinterpret_cast<const void*>(v), sizeof(T));
return tmp;
}