This is the mail archive of the gdb-prs@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]

win32/2166: Unchecked file close causes SEGV


>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
>Closed-Date:
>Last-Modified:
>Originator:     roblip@gmail.com
>Release:        gdb-6.5.50.20060902
>Organization:
>Environment:
Windows 2003 X64, cygwin 1.5.21
>Description:
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);
........
}
>How-To-Repeat:
gdb.exe gdb.exe
> run
Error: dll starting at 0x77d41000 not found.
SEGV
>Fix:
Add check before bfd_close(abfd), ie:

if (abfd)
  bfd_close(abfd)
>Release-Note:
>Audit-Trail:
>Unformatted:


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