17d6efc44b
% gdb -q '' ... or ... % gdb -q (gdb) file '' ... both cause GDB to crash with an invalid free. This is because exec_file_attach is attempting to free a string that has not been allocated. The string is only allocated if openp is successful. But in the case of this obviously invalid filename, openp fails, and leaves scratch_pathname uninitialized, thus causing the xfree to fail. The fix is to enable the associated cleanup after we have verified that openp was successful. gdb/ChangeLog (By Keith Seitz <keiths@redhat.com>): * exec.c (exec_file_attach): Move cleanup after verifying that memory has in fact been allocated. gdb/testsuite/ChangeLog: * gdb.base/empty_exe.exp: New testcase. |
||
---|---|---|
.. | ||
boards | ||
config | ||
gdb.ada | ||
gdb.arch | ||
gdb.asm | ||
gdb.base | ||
gdb.cell | ||
gdb.cp | ||
gdb.disasm | ||
gdb.dwarf2 | ||
gdb.fortran | ||
gdb.gdb | ||
gdb.go | ||
gdb.hp | ||
gdb.java | ||
gdb.linespec | ||
gdb.mi | ||
gdb.modula2 | ||
gdb.multi | ||
gdb.objc | ||
gdb.opencl | ||
gdb.opt | ||
gdb.pascal | ||
gdb.python | ||
gdb.reverse | ||
gdb.server | ||
gdb.stabs | ||
gdb.threads | ||
gdb.trace | ||
gdb.xml | ||
lib | ||
aclocal.m4 | ||
ChangeLog | ||
configure | ||
configure.ac | ||
dg-extract-results.sh | ||
Makefile.in | ||
TODO |