diff options
author | Alan Modra <amodra@gmail.com> | 2022-11-23 22:07:03 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-11-23 22:38:48 +1030 |
commit | d499fb89448c3f2e061813f12a1b63fbaa29422e (patch) | |
tree | 7c890950c7175781603eb8d96f26f444a7fa3ed1 | |
parent | 8181f0045df765a7f28db745f4a8bd3c5a1da82d (diff) | |
download | gdb-d499fb89448c3f2e061813f12a1b63fbaa29422e.zip gdb-d499fb89448c3f2e061813f12a1b63fbaa29422e.tar.gz gdb-d499fb89448c3f2e061813f12a1b63fbaa29422e.tar.bz2 |
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.
-rw-r--r-- | bfd/wasm-module.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/wasm-module.c b/bfd/wasm-module.c index 2c2c6c7..c96665b 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; } |