enforce first null byte in CANARY

+ added MI_CANARY_MASK to enforce the LSB is 0
This commit is contained in:
gfelber 2024-10-27 10:59:56 +01:00
parent 3cba10e510
commit eaafec4461
2 changed files with 2 additions and 1 deletions

View file

@ -472,6 +472,7 @@ typedef struct mi_padding_s {
uint32_t canary; // encoded block value to check validity of the padding (in case of overflow)
uint32_t delta; // padding bytes before the block. (mi_usable_size(p) - delta == exact allocated bytes)
} mi_padding_t;
#define MI_CANARY_MASK (0xffffff00)
#define MI_PADDING_SIZE (sizeof(mi_padding_t))
#define MI_PADDING_WSIZE ((MI_PADDING_SIZE + MI_INTPTR_SIZE - 1) / MI_INTPTR_SIZE)
#else