From 6856975ed4ce79355752d08938f066f2ed9fcfb5 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Thu, 22 Jul 2021 18:38:16 +0530 Subject: mcheck Fix malloc_usable_size [BZ #22057] Interpose malloc_usable_size to return the correct mcheck value for malloc_usable_size. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- malloc/mcheck-impl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'malloc/mcheck-impl.c') diff --git a/malloc/mcheck-impl.c b/malloc/mcheck-impl.c index 8857e6b179..6597a290a6 100644 --- a/malloc/mcheck-impl.c +++ b/malloc/mcheck-impl.c @@ -404,3 +404,9 @@ __mcheck_initialize (void (*func) (enum mcheck_status), bool in_pedantic) pedantic = in_pedantic; return 0; } + +static int +mcheck_usable_size (struct hdr *h) +{ + return (h - 1)->size; +} -- cgit v1.2.3