Skip to content

Commit

Permalink
Fix pointer arithmetic on canary placement
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPxt committed Oct 10, 2024
1 parent 8a087f3 commit fa7c45e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zxcanary.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit fa7c45e

Please sign in to comment.