From: Alan Modra Date: Wed, 23 Nov 2022 11:37:03 +0000 (+1030) Subject: asan: NULL deref in filter_symbols X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d499fb89448c3f2e061813f12a1b63fbaa29422e;p=binutils-gdb.git asan: NULL deref in filter_symbols If tdata->symbols is NULL, make tdata->symcount zero too. This makes wasm_get_symtab_upper_bound return the proper result and stops cascading errors. * wasm-module.c (wasm_scan_name_function_section): Clear tdata->symcount on error. --- diff --git a/bfd/wasm-module.c b/bfd/wasm-module.c index 2c2c6c72863..c96665b6e91 100644 --- a/bfd/wasm-module.c +++ b/bfd/wasm-module.c @@ -359,6 +359,7 @@ wasm_scan_name_function_section (bfd *abfd, sec_ptr asect) error_return: if (symbols) bfd_release (abfd, symbols); + tdata->symcount = 0; return false; }