win32/2166: Unchecked file close causes SEGV
Sat Sep 2 23:28:00 GMT 2006

>Number:         2166
>Category:       win32
>Synopsis:       Unchecked file close causes SEGV
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 02 23:28:01 UTC 2006
>Release:        gdb-
Windows 2003 X64, cygwin 1.5.21
When attempting to load symbols from a nonexistent file, gdb crashes in bfd_close() called from win32-nat.c:

solib_symbols_add (struct so_list *so, CORE_ADDR load_addr)
  abfd = bfd_openr (name, "pei-i386");
  bfd_close (abfd);
gdb.exe gdb.exe
> run
Error: dll starting at 0x77d41000 not found.
Add check before bfd_close(abfd), ie:

if (abfd)

More information about the Gdb-prs mailing list