mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-13 06:34:42 -04:00
Enable building ffsparser_fuzzer during CI/CD, improve readUnaligned to silence Clang UBSAN
This commit is contained in:
parent
ff42cecb07
commit
369f10188c
2 changed files with 30 additions and 2 deletions
28
.github/workflows/main.yml
vendored
28
.github/workflows/main.yml
vendored
|
@ -300,6 +300,34 @@ jobs:
|
||||||
cmake -G "MinGW Makefiles" -B build .
|
cmake -G "MinGW Makefiles" -B build .
|
||||||
cmake --build build --parallel
|
cmake --build build --parallel
|
||||||
|
|
||||||
|
build_test_linux_fuzzer:
|
||||||
|
name: Fuzzer build test (Clang, Linux x64)
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Create build directory
|
||||||
|
run: cmake -E make_directory ${{runner.workspace}}/build
|
||||||
|
- name: Configure everything
|
||||||
|
working-directory: ${{runner.workspace}}/build
|
||||||
|
run: CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake ../UEFITool/fuzzing
|
||||||
|
- name: Build everything
|
||||||
|
working-directory: ${{runner.workspace}}/build
|
||||||
|
shell: bash
|
||||||
|
run: cmake --build .
|
||||||
|
- name: Create dist directory
|
||||||
|
run: cmake -E make_directory ${{runner.workspace}}/dist
|
||||||
|
- name: Archive everything
|
||||||
|
working-directory: ${{runner.workspace}}/build
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
UEFITOOL_VER=$(cat ../UEFITool/version.h | grep PROGRAM_VERSION | cut -d'"' -f2 | sed 's/NE alpha /A/') ; \
|
||||||
|
zip -qryj ../dist/ffsparser_fuzzer_NE_${UEFITOOL_VER}_x64_linux.zip ./ffsparser_fuzzer
|
||||||
|
- name: Upload to artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Fuzzer
|
||||||
|
path: ${{runner.workspace}}/dist/*.zip
|
||||||
|
|
||||||
# Static Analysis
|
# Static Analysis
|
||||||
build_analyze_linux_coverity:
|
build_analyze_linux_coverity:
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -70,7 +70,7 @@ INTN findPattern(const UINT8 *pattern, const UINT8 *patternMask, UINTN patternSi
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline T readUnaligned(const T *v) {
|
inline T readUnaligned(const T *v) {
|
||||||
T tmp = {};
|
T tmp = {};
|
||||||
memcpy(&tmp, v, sizeof(T));
|
memcpy(reinterpret_cast<void*>(&tmp), reinterpret_cast<const void*>(v), sizeof(T));
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue