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.
This commit is contained in:
H.J. Lu 2012-08-27 17:00:42 +00:00
parent 1c8cdcb14f
commit f629cd7572
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2010-08-27 H.J. Lu <hongjiu.lu@intel.com>
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 <jan.kratochvil@redhat.com>
* breakpoint.c (parse_breakpoint_sals) <(*address) == NULL>: New

View File

@ -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,