From a7d32259cf00565986d065c93be25dc82bb1a024 Mon Sep 17 00:00:00 2001 From: David Steele Date: Sun, 24 Jan 2021 08:05:31 -0500 Subject: [PATCH] Avoid NULL pointer arithmetic in MemContext unit test. Similar to b23a2a0b. In this case add 1 to avoid a NULL pointer. Found on MacOS M1. --- test/src/module/common/memContextTest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/module/common/memContextTest.c b/test/src/module/common/memContextTest.c index f50626005..41e38a3b9 100644 --- a/test/src/module/common/memContextTest.c +++ b/test/src/module/common/memContextTest.c @@ -170,7 +170,7 @@ testRun(void) if (testBegin("memContextAlloc(), memNew*(), memGrow(), and memFree()")) { TEST_RESULT_UINT(sizeof(MemContextAlloc), 8, "check MemContextAlloc size (same for 32/64 bit)"); - TEST_RESULT_PTR(MEM_CONTEXT_ALLOC_BUFFER((void *)0), (void *)sizeof(MemContextAlloc), "check buffer macro"); + TEST_RESULT_PTR(MEM_CONTEXT_ALLOC_BUFFER((void *)1), (void *)(sizeof(MemContextAlloc) + 1), "check buffer macro"); TEST_RESULT_PTR(MEM_CONTEXT_ALLOC_HEADER((void *)sizeof(MemContextAlloc)), (void *)0, "check header macro"); memContextSwitch(memContextTop());