From 9acc5c85391a5121410ad4971b0b92200f4dd866 Mon Sep 17 00:00:00 2001 From: Henry Poggie Date: Mon, 14 Jan 2019 19:45:31 -0500 Subject: [PATCH 1/4] Add ignore for asan --- asan_ignore.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 asan_ignore.txt diff --git a/asan_ignore.txt b/asan_ignore.txt new file mode 100644 index 0000000000..7c87f32f87 --- /dev/null +++ b/asan_ignore.txt @@ -0,0 +1 @@ +fun:VM_Call From db64ddcc2c62078b910803a459e702e9034b12b8 Mon Sep 17 00:00:00 2001 From: Henry Poggie Date: Mon, 14 Jan 2019 19:45:49 -0500 Subject: [PATCH 2/4] Fix strncpy copying a string onto itself --- code/client/cl_cgame.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/client/cl_cgame.c b/code/client/cl_cgame.c index 31a6a4d981..ebab835931 100644 --- a/code/client/cl_cgame.c +++ b/code/client/cl_cgame.c @@ -618,7 +618,9 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) { Com_Memcpy( VMA(1), VMA(2), args[3] ); return 0; case CG_STRNCPY: - strncpy( VMA(1), VMA(2), args[3] ); + if (VMA(1) != VMA(2)) { + strncpy( VMA(1), VMA(2), args[3] ); + } return args[1]; case CG_SIN: return FloatAsInt( sin( VMF(1) ) ); From 13e30824f9d6112d5ae8cc057ca36eab83aa8e22 Mon Sep 17 00:00:00 2001 From: Henry Poggie Date: Wed, 23 Jan 2019 09:32:03 -0500 Subject: [PATCH 3/4] Add Makefile.local.asan --- Makefile.local.asan | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Makefile.local.asan diff --git a/Makefile.local.asan b/Makefile.local.asan new file mode 100644 index 0000000000..7cbbe43f65 --- /dev/null +++ b/Makefile.local.asan @@ -0,0 +1,7 @@ +# Compiles with ASan (https://github.com/google/sanitizers/wiki/AddressSanitizer) +# How to use: +# cp Makefile.local.asan Makefile.local && make +CC=clang +CFLAGS+=-fsanitize=address +CFLAGS+=-g +CFLAGS+=-fsanitize-recover=address From 9cffc4a122387ca46d13365cfea5702c61de63b0 Mon Sep 17 00:00:00 2001 From: Henry Poggie Date: Mon, 11 Feb 2019 21:25:26 -0500 Subject: [PATCH 4/4] Fix asan ignore list not being used --- Makefile.local.asan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.local.asan b/Makefile.local.asan index 7cbbe43f65..61a54718a8 100644 --- a/Makefile.local.asan +++ b/Makefile.local.asan @@ -4,4 +4,4 @@ CC=clang CFLAGS+=-fsanitize=address CFLAGS+=-g -CFLAGS+=-fsanitize-recover=address +CFLAGS+=-fsanitize-blacklist=asan_ignore.txt