From c584fc75bb57ba275605c66522cbae45098d56f0 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 2 May 2012 21:30:53 +0200 Subject: [PATCH] Don't use sizeof() on a VARIABLE_ARRAY In the alloca() case, this fails to be the right size. --- src/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stats.c b/src/stats.c index 1234e565..433b80d1 100644 --- a/src/stats.c +++ b/src/stats.c @@ -494,7 +494,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, size_t isz; unsigned i, ninitialized; - isz = sizeof(initialized); + isz = sizeof(bool) * narenas; xmallctl("arenas.initialized", initialized, &isz, NULL, 0); for (i = ninitialized = 0; i < narenas; i++) { @@ -523,7 +523,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, size_t isz; unsigned i; - isz = sizeof(initialized); + isz = sizeof(bool) * narenas; xmallctl("arenas.initialized", initialized, &isz, NULL, 0);