From ba54aca3a47df0e8c7afde968bd5f7479372a404 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 24 Oct 2026 03:43:34 +0200 Subject: factor out accesslist parser to fix a potential out of bound read and add tests to the accesslist unit --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a6b0b9b..e96269f 100644 --- a/Makefile +++ b/Makefile @@ -105,10 +105,13 @@ proxy.debug: $(OBJECTS_proxy_debug) $(HEADERS) # has to. tests/stubs.c supplies the few symbols those modules reference but # the tests never reach. TESTBIN=tests/runner -TEST_SOURCES=tests/runner.c tests/test.c tests/stubs.c tests/t_scan_urlencoded_query.c tests/t_iovec.c tests/t_vector.c tests/t_random.c tests/t_hex.c -TEST_UNITS=scan_urlencoded_query.c ot_iovec.c ot_vector.c ot_random.c ot_hex.c +TEST_SOURCES=tests/runner.c tests/test.c tests/stubs.c tests/t_scan_urlencoded_query.c tests/t_iovec.c tests/t_vector.c tests/t_random.c tests/t_hex.c tests/t_accesslist.c +TEST_UNITS=scan_urlencoded_query.c ot_iovec.c ot_vector.c ot_random.c ot_hex.c ot_accesslist.c TEST_HEADERS=tests/test.h $(HEADERS) -CFLAGS_test = $(CFLAGS) -I. -g -O1 $(FEATURES) +# Tests reach code that sits behind feature flags, so the units under test are +# built with those features enabled. A test binary is not a production binary. +FEATURES_test=$(FEATURES) -DWANT_ACCESSLIST_BLACK +CFLAGS_test = $(CFLAGS) -I. -g -O1 $(FEATURES_test) $(TESTBIN): $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS) $(CC) -o $@ $(CFLAGS_test) $(TEST_SOURCES) $(TEST_UNITS) -- cgit v1.3