public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix latent bug in set_is_exec_point_at
@ 2019-06-25 14:03 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-06-25 14:03 UTC (permalink / raw)
  To: gdb-cvs

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

commit f7952c5774671414d9e0e8d3524c2921daa6f28e
Author: Tom Tromey <tom@tromey.com>
Date:   Sun Jun 23 16:07:12 2019 -0600

    Fix latent bug in set_is_exec_point_at
    
    valgrind pointed out that the TUI was using uninitialized memory in
    set_is_exec_point_at.  The bug is a missing check against LOA_ADDRESS,
    causing gdb to examine the uninitialized bits of the "addr" field.
    
    gdb/ChangeLog
    2019-06-25  Tom Tromey  <tom@tromey.com>
    
    	* tui/tui-winsource.c
    	(tui_source_window_base::set_is_exec_point_at): Add check against
    	LOA_ADDRESS.

Diff:
---
 gdb/ChangeLog           | 6 ++++++
 gdb/tui/tui-winsource.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9898bcd..43ed9bc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2019-06-25  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-winsource.c
+	(tui_source_window_base::set_is_exec_point_at): Add check against
+	LOA_ADDRESS.
+
+2019-06-25  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui-source.c (tui_set_source_content): Don't check before
 	xfree.
 	* tui/tui-disasm.c (tui_disassemble): Don't check before xfree.
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 93c6253..6ec1f1b 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -365,7 +365,7 @@ tui_source_window_base::set_is_exec_point_at (struct tui_line_or_address l)
 		  || content_loa.loa == LOA_ADDRESS);
       if (content_loa.loa == l.loa
 	  && ((l.loa == LOA_LINE && content_loa.u.line_no == l.u.line_no)
-              || (content_loa.u.addr == l.u.addr)))
+              || (l.loa == LOA_ADDRESS && content_loa.u.addr == l.u.addr)))
         new_state = true;
       else
 	new_state = false;


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

only message in thread, other threads:[~2019-06-25 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25 14:03 [binutils-gdb] Fix latent bug in set_is_exec_point_at Tom Tromey

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).