From 9b7691a2a745f8d89e36d6103947bdeee1b31a3c Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 4 Oct 2018 02:52:20 -0400 Subject: [PATCH] take canaries into account for the offset test --- test/offset.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/offset.c b/test/offset.c index 7eae781..f88d01f 100644 --- a/test/offset.c +++ b/test/offset.c @@ -17,10 +17,15 @@ static const unsigned size_classes[] = { #define N_SIZE_CLASSES (sizeof(size_classes) / sizeof(size_classes[0])) +static size_t canary_size = 8; + int main(void) { void *p[N_SIZE_CLASSES]; for (unsigned i = 0; i < N_SIZE_CLASSES; i++) { unsigned size = size_classes[i]; + if (size) { + size -= canary_size; + } p[i] = malloc(size); if (!p) { return 1;