From f629cd75725e5f99966e39af06178aad4787445b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 27 Aug 2012 17:00:42 +0000 Subject: [PATCH] Check if TUI_SRC_WIN is not NULL before referencing it PR tui/14486 * tui/tui-source.c (tui_source_is_displayed): Check if TUI_SRC_WIN is not NULL before referencing it. --- gdb/ChangeLog | 6 ++++++ gdb/tui/tui-source.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e20414b..71014b9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2010-08-27 H.J. Lu + + PR tui/14486 + * tui/tui-source.c (tui_source_is_displayed): Check if TUI_SRC_WIN + is not NULL before referencing it. + 2012-08-27 Jan Kratochvil * breakpoint.c (parse_breakpoint_sals) <(*address) == NULL>: New diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 9ba9b1d..030653c 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -334,7 +334,8 @@ tui_show_symtab_source (struct gdbarch *gdbarch, struct symtab *s, int tui_source_is_displayed (char *fname) { - return (TUI_SRC_WIN->generic.content_in_use + return (TUI_SRC_WIN != NULL + && TUI_SRC_WIN->generic.content_in_use && (filename_cmp (((struct tui_win_element *) (tui_locator_win_info_ptr ())-> content[0])->which_element.locator.file_name, -- 2.7.4