From ba3af0b1965a87dd4a266a4cd29043e9dfdcf625 Mon Sep 17 00:00:00 2001 From: Shengyun Zhou Date: Tue, 20 Sep 2022 20:47:17 +0800 Subject: [PATCH] AOT: fix crash in dumping call stack when the AOT file doesn't contain custom name section (#1508) --- core/iwasm/aot/aot_runtime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/iwasm/aot/aot_runtime.c b/core/iwasm/aot/aot_runtime.c index ddafd918..c0e4e3e2 100644 --- a/core/iwasm/aot/aot_runtime.c +++ b/core/iwasm/aot/aot_runtime.c @@ -2920,6 +2920,9 @@ lookup_func_name(const char **func_names, uint32 *func_indexes, int64 low = 0, mid; int64 high = func_index_count - 1; + if (!func_names || !func_indexes || func_index_count == 0) + return NULL; + while (low <= high) { mid = (low + high) / 2; if (func_index == func_indexes[mid]) {