1
0
Fork 0
mirror of https://github.com/LongSoft/UEFITool.git synced 2025-05-31 15:28:21 -04:00

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
common

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;
}