asan: abort in wasm_scan_name_function_section

Alan Modra amodra@gmail.com
Fri Dec 17 05:45:51 GMT 2021


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.

diff --git a/bfd/wasm-module.c b/bfd/wasm-module.c
index 9735ebeabca..ca7e38179e9 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;
 }
 

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list