old-cross-binutils/gdb/testsuite
Joel Brobecker 17d6efc44b Do not crash when calling GDB with empty executable name.
% 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.
2012-11-26 17:41:44 +00:00
..
boards * boards/dwarf4-gdb-index.exp: New file. 2012-09-20 15:21:09 +00:00
config
gdb.ada [Ada] Allow assignment to wide string. 2012-10-24 18:14:23 +00:00
gdb.arch * gdb.threads/gcore-thread.exp: Use gdb_gcore_cmd. 2012-11-06 15:21:24 +00:00
gdb.asm
gdb.base Do not crash when calling GDB with empty executable name. 2012-11-26 17:41:44 +00:00
gdb.cell * gdb.threads/gcore-thread.exp: Use gdb_gcore_cmd. 2012-11-06 15:21:24 +00:00
gdb.cp PR c++/13615 2012-11-16 20:54:30 +00:00
gdb.disasm
gdb.dwarf2 Remove trailing '#' in gdb.dwarf2/dw2-icc-opaque.S 2012-10-15 17:26:14 +00:00
gdb.fortran 2012-09-26 Jan Kratochvil <jan.kratochvil@redhat.com> 2012-09-26 19:38:32 +00:00
gdb.gdb 2012-09-08 Khoo Yit Phang <khooyp@cs.umd.edu> 2012-09-08 05:29:21 +00:00
gdb.go
gdb.hp
gdb.java gdb/testsuite/ 2012-10-15 19:11:56 +00:00
gdb.linespec PR breakpoints/14643. 2012-10-11 16:12:05 +00:00
gdb.mi gdb/testsuite/ 2012-11-20 02:55:10 +00:00
gdb.modula2
gdb.multi 2012-11-09 Pedro Alves <palves@redhat.com> 2012-11-09 12:20:24 +00:00
gdb.objc
gdb.opencl
gdb.opt
gdb.pascal
gdb.python http://sourceware.org/ml/gdb-patches/2012-11/msg00308.html 2012-11-14 10:16:46 +00:00
gdb.reverse gdb/testsuite/ 2012-10-16 13:14:36 +00:00
gdb.server
gdb.stabs
gdb.threads gdb/testsuite/ 2012-11-14 05:52:32 +00:00
gdb.trace gdb/testsuite: 2012-10-25 14:56:09 +00:00
gdb.xml http://sourceware.org/ml/gdb-patches/2012-09/msg00015.html 2012-09-14 21:23:45 +00:00
lib * c-typeprint.c (find_typedef_for_canonicalize, 2012-11-12 17:37:38 +00:00
aclocal.m4
ChangeLog Do not crash when calling GDB with empty executable name. 2012-11-26 17:41:44 +00:00
configure
configure.ac
dg-extract-results.sh
Makefile.in
TODO