From a7ff216340a67c6d44001b67fe400fb0fd5f5436 Mon Sep 17 00:00:00 2001 From: wargio Date: Fri, 13 Sep 2024 09:53:14 +0800 Subject: [PATCH] Always check for null when calling calloc in dyldcache.c --- librz/bin/format/mach0/dyldcache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/librz/bin/format/mach0/dyldcache.c b/librz/bin/format/mach0/dyldcache.c index be1511a1385..64a840cdd35 100644 --- a/librz/bin/format/mach0/dyldcache.c +++ b/librz/bin/format/mach0/dyldcache.c @@ -319,6 +319,9 @@ static void populate_cache_maps(RzDyldCache *cache) { return; } cache_map_t *maps = RZ_NEWS0(cache_map_t, n_maps); + if (!maps) { + return; + } ut32 next_map = 0; ut32 last_idx = UT32_MAX;