diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2021-07-22 18:38:16 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2021-07-22 18:38:16 +0530 |
commit | 6856975ed4ce79355752d08938f066f2ed9fcfb5 (patch) | |
tree | 0ef325b468fc9dcc399a854b17433fb7969fa79d /malloc/mcheck-impl.c | |
parent | 1e5a5866cb9541b5231dba3d86c8a1a35d516de9 (diff) | |
download | glibc-6856975ed4ce79355752d08938f066f2ed9fcfb5.tar glibc-6856975ed4ce79355752d08938f066f2ed9fcfb5.tar.gz glibc-6856975ed4ce79355752d08938f066f2ed9fcfb5.tar.bz2 glibc-6856975ed4ce79355752d08938f066f2ed9fcfb5.zip |
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 <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'malloc/mcheck-impl.c')
-rw-r--r-- | malloc/mcheck-impl.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; +} |