aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-12-17 14:54:54 +1030
committerAlan Modra <amodra@gmail.com>2021-12-17 16:01:34 +1030
commitcfabce5ba10ea15158c78bdac732425a46057e42 (patch)
tree5ce5ded0079f7e82a6cf6e44426de9453e4a320b /bfd
parent9b54b561858b3fb265f57d2b4ddf35fba2603069 (diff)
downloadgdb-cfabce5ba10ea15158c78bdac732425a46057e42.zip
gdb-cfabce5ba10ea15158c78bdac732425a46057e42.tar.gz
gdb-cfabce5ba10ea15158c78bdac732425a46057e42.tar.bz2
asan: abort in wasm_scan_name_function_section
Macros like READ_LEB128 in wasm-module.c that alter control flow are evil. Maintainers will break your code if you have hidden ways to reach labels. * wasm-module.c (wasm_scan_name_function_section): Don't attempt to bfd_release NULL.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/wasm-module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/wasm-module.c b/bfd/wasm-module.c
index 9735ebe..ca7e381 100644
--- a/bfd/wasm-module.c
+++ b/bfd/wasm-module.c
@@ -357,7 +357,8 @@ wasm_scan_name_function_section (bfd *abfd, sec_ptr asect)
return true;
error_return:
- bfd_release (abfd, symbols);
+ if (symbols)
+ bfd_release (abfd, symbols);
return false;
}