public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] asan: double free sb_kill
@ 2022-06-08 12:03 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-06-08 12:03 UTC (permalink / raw)
  To: bfd-cvs

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

commit 38ef9f36cf2c31bef5d3c0f122cadd5b8c291c0e
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Jun 6 14:27:17 2022 +0930

    asan: double free sb_kill
    
    oss-fuzz hits a flaky crash with a double-free.  I think this is due
    to gas static state not being reinitialised between testcases, a bug
    with oss-fuzz not gas.  Anyway, this patch should avoid the problem.
    
            * input-scrub.c (input_scrub_push): Move init of sb_index..
            (input_scrub_reinit): ..to here.

Diff:
---
 gas/input-scrub.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gas/input-scrub.c b/gas/input-scrub.c
index f65cd7957b1..ec0b007c77a 100644
--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -139,6 +139,7 @@ input_scrub_reinit (void)
   input_file_begin ();		/* Reinitialize! */
   logical_input_line = -1u;
   logical_input_file = NULL;
+  sb_index = -1;
 
   buffer_length = input_file_buffer_size () * 2;
   buffer_start = XNEWVEC (char, BEFORE_SIZE + AFTER_SIZE + 1 + buffer_length);
@@ -172,8 +173,6 @@ input_scrub_push (char *saved_position)
   saved->next_saved_file = next_saved_file;
   saved->input_file_save = input_file_push ();
 
-  sb_index = -1;
-
   input_scrub_reinit ();
 
   return saved;


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

only message in thread, other threads:[~2022-06-08 12:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:03 [binutils-gdb] asan: double free sb_kill 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).