aboutgitcodelistschat:MatrixIRC
path: root/tests/unit/Makefile
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-05-09 10:38:21 +0200
committerAlice Frosi <afrosi@redhat.com>2023-05-09 15:58:23 +0200
commit0977f0876af186975d3861c53b8431a80a27fa83 (patch)
tree9ace2c75d0389175591e8f3b9cf7e6589330514f /tests/unit/Makefile
parent384d09cd3d2e62bae19b59b615bc57b7a23d0b0a (diff)
downloadseitan-0977f0876af186975d3861c53b8431a80a27fa83.tar
seitan-0977f0876af186975d3861c53b8431a80a27fa83.tar.gz
seitan-0977f0876af186975d3861c53b8431a80a27fa83.tar.bz2
seitan-0977f0876af186975d3861c53b8431a80a27fa83.tar.lz
seitan-0977f0876af186975d3861c53b8431a80a27fa83.tar.xz
seitan-0977f0876af186975d3861c53b8431a80a27fa83.tar.zst
seitan-0977f0876af186975d3861c53b8431a80a27fa83.zip
gluten: check limits
Add bounds checking: - if offset is larger then the maximum per offset type - if memcpy is reading/writing inside gluten
Diffstat (limited to 'tests/unit/Makefile')
-rw-r--r--tests/unit/Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/Makefile b/tests/unit/Makefile
index 202e198..966ae7d 100644
--- a/tests/unit/Makefile
+++ b/tests/unit/Makefile
@@ -23,6 +23,10 @@ HEADERS_OP := $(COMMON_DIR)/gluten.h $(OP_DIR)/operations.h \
$(COMMON_DIR)/common.h testutil.h $(COMMON_DIR)/util.h
SRCS_OP := $(COMMON_DIR)/common.c $(OP_DIR)/operations.c util.c $(COMMON_DIR)/util.c
+HEADERS_ERROR := $(COMMON_DIR)/gluten.h $(OP_DIR)/operations.h \
+ $(COMMON_DIR)/common.h testutil.h $(COMMON_DIR)/util.h
+SRCS_ERROR := $(COMMON_DIR)/common.c $(OP_DIR)/operations.c util.c $(COMMON_DIR)/util.c
+
TARGET := $(shell $(CC) -dumpmachine)
TARGET_ARCH := $(shell echo $(TARGET) | cut -f1 -d- | tr [A-Z] [a-z])
TARGET_ARCH := $(shell echo $(TARGET_ARCH) | sed 's/powerpc/ppc/')
@@ -67,5 +71,11 @@ build-operations: test_operations.c $(SRCS_OP) $(HEADERS_OP)
test-operations: build-operations
./operations
+build-error-checks: test_errors.c $(SRCS_ERROR) $(HEADERS_ERROR)
+ $(CC) $(CFLAGS) -o error_checks $(SRCS_ERROR) \
+ test_errors.c
+
+test-error-checks: build-error-checks
+ ./error_checks
clean:
rm -f operations op-call filter filter-build