public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] asan: NULL deref in filter_symbols
@ 2022-11-23 12:29 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-11-23 12:29 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d499fb89448c3f2e061813f12a1b63fbaa29422e

commit d499fb89448c3f2e061813f12a1b63fbaa29422e
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Nov 23 22:07:03 2022 +1030

    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:
---
 bfd/wasm-module.c | 1 +
 1 file changed, 1 insertion(+)

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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-23 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 12:29 [binutils-gdb] asan: NULL deref in filter_symbols Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).