about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDominic Chen <d.c.ddcc@gmail.com>2020-11-25 02:53:16 -0500
committerRich Felker <dalias@aerifal.cx>2020-11-29 01:07:05 -0500
commit5d464f524ba5447e2a8fc77560b98c1ad9a83570 (patch)
tree41e35b35dd9f665c329729611c4c6d04193e8f94
parentd046ec92c1e5a487a8f9d584ebb79c3bc97ea95f (diff)
downloadmusl-5d464f524ba5447e2a8fc77560b98c1ad9a83570.tar.gz
musl-5d464f524ba5447e2a8fc77560b98c1ad9a83570.tar.xz
musl-5d464f524ba5447e2a8fc77560b98c1ad9a83570.zip
fix mallocng regression in malloc_usable_size with null argument
commit d1507646975cbf6c3e511ba07b193f27f032d108 added support for null
argument in oldmalloc and was overlooked when switching to mallocng.
-rw-r--r--src/malloc/mallocng/malloc_usable_size.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/malloc/mallocng/malloc_usable_size.c b/src/malloc/mallocng/malloc_usable_size.c
index a440a4ea..ce6a960c 100644
--- a/src/malloc/mallocng/malloc_usable_size.c
+++ b/src/malloc/mallocng/malloc_usable_size.c
@@ -3,6 +3,7 @@
 
 size_t malloc_usable_size(void *p)
 {
+	if (!p) return 0;
 	struct meta *g = get_meta(p);
 	int idx = get_slot_index(p);
 	size_t stride = get_stride(g);