wmbus: fix format-A length formula for L=10 (mod 16); host tests under ASan

This commit is contained in:
Lars Nolden
2026-09-01 11:28:14 +02:00
parent c835c62172
commit 6bdcb2acad
6 changed files with 302 additions and 3 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Build and run the host-side wM-Bus frame tests under AddressSanitizer.
# The sanitizer is the point: these tests feed adversarial lengths through
# the CRC walk, and only ASan makes an out-of-bounds read observable.
set -euo pipefail
cd "$(dirname "$0")"
CC=${CC:-gcc}
OUT=$(mktemp -d)
trap 'rm -rf "$OUT"' EXIT
"$CC" -std=c11 -O1 -g -Wall -Wextra -Werror \
-fsanitize=address,undefined -fno-omit-frame-pointer \
-o "$OUT/test_wmbus" test_wmbus.c ../main/wmbus.c
"$OUT/test_wmbus"