This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb and binutils branch master updated. 6e5d7f393ed899c8e980b238be3cf23ec296e3f6


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  6e5d7f393ed899c8e980b238be3cf23ec296e3f6 (commit)
      from  1e1e619b6b382f9b354d78018ddb73f0070375d2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

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

commit 6e5d7f393ed899c8e980b238be3cf23ec296e3f6
Author: Pedro Alves <palves@redhat.com>
Date:   Wed Oct 29 11:57:03 2014 +0000

    Fix uninitialized value access when very first GDB command entered is <RET>
    
    While running GDB under Valgrind, I noticed that if the very first
    command entered is just <RET>, GDB accesses an uninitialized value:
    
     $ valgrind ./gdb -q -nx
     ==26790== Memcheck, a memory error detector
     ==26790== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
     ==26790== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
     ==26790== Command: ./gdb -q -nx
     ==26790==
    
     (gdb)
     ==26790== Conditional jump or move depends on uninitialised value(s)
     ==26790==    at 0x619DFC: command_line_handler (event-top.c:588)
     ==26790==    by 0x7813D5: rl_callback_read_char (callback.c:220)
     ==26790==    by 0x6194B4: rl_callback_read_char_wrapper (event-top.c:166)
     ==26790==    by 0x61988A: stdin_event_handler (event-top.c:372)
     ==26790==    by 0x61847D: handle_file_event (event-loop.c:762)
     ==26790==    by 0x617964: process_event (event-loop.c:339)
     ==26790==    by 0x617A2B: gdb_do_one_event (event-loop.c:403)
     ==26790==    by 0x617A7B: start_event_loop (event-loop.c:428)
     ==26790==    by 0x6194E6: cli_command_loop (event-top.c:181)
     ==26790==    by 0x60F86B: current_interp_command_loop (interps.c:317)
     ==26790==    by 0x610A34: captured_command_loop (main.c:321)
     ==26790==    by 0x60C728: catch_errors (exceptions.c:237)
     ==26790==
     (gdb)
    
    It's this check here:
    
      /* If we just got an empty line, and that is supposed to repeat the
         previous command, return the value in the global buffer.  */
      if (repeat && p == linebuffer && *p != '\\')
        {
    
    The problem is that linebuffer's contents were never initialized at
    this point.
    
    gdb/
    2014-10-29  Pedro Alves  <palves@redhat.com>
    
    	* event-top.c (command_line_handler): Clear the first byte of
    	linebuffer, when it is first allocated.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog   |    5 +++++
 gdb/event-top.c |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
gdb and binutils


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]