From 569270d8603d68308ad8bf8ef4cad4b09101d35e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 28 Apr 2023 11:55:10 -0400 Subject: Test (and fix) ImageAddress() This adds a test case for our address sanitation checking function ImageAddresS(). In doing so it addresses two issues: - previously we allowed the address after the last byte of the image to be computed (may need to revert this or fix some callers, we'll see...) - bespoke overflow checking and using + directly instead of using __builtin_add_overflow() Signed-off-by: Peter Jones --- include/test.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/test.mk b/include/test.mk index c37b8446..e6d46594 100644 --- a/include/test.mk +++ b/include/test.mk @@ -95,6 +95,9 @@ test-mok-mirror: CFLAGS+=-DHAVE_START_IMAGE -DHAVE_SHIM_LOCK_GUID test-sbat_FILES = csv.c lib/variables.c lib/guid.c sbat_var.S mock-variables.c test-sbat :: CFLAGS+=-DHAVE_GET_VARIABLE -DHAVE_GET_VARIABLE_ATTR -DHAVE_SHIM_LOCK_GUID +test-pe-relocate_FILES = globals.c +test-pe-relocate :: CFLAGS+=-DHAVE_SHIM_LOCK_GUID + test-str_FILES = lib/string.c tests := $(patsubst %.c,%,$(wildcard test-*.c)) -- cgit v1.2.3