From fa7c45ebb18a18857b28b237f2e1b182d20cbff4 Mon Sep 17 00:00:00 2001 From: 0xPxt Date: Thu, 10 Oct 2024 16:26:58 +0200 Subject: [PATCH] Fix pointer arithmetic on canary placement --- src/zxcanary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zxcanary.c b/src/zxcanary.c index 16394e4..5b515f3 100644 --- a/src/zxcanary.c +++ b/src/zxcanary.c @@ -20,7 +20,7 @@ // This symbol is defined by the link script to be at the start of the stack area. extern unsigned int app_stack_canary; -#define ZONDAX_CANARY (*((volatile uint32_t*) (&app_stack_canary + sizeof(uint32_t)))) +#define ZONDAX_CANARY (*((volatile uint32_t*) (((uint8_t*) &app_stack_canary) + sizeof(uint32_t)))) #if defined(HAVE_ZONDAX_CANARY) #include "errors.h"