binutils-gdb/gdb/common
Sergio Durigan Junior 2f91880f3a Fix possible bug when no args have been provided to the executable
Hi,

This bug is related to:

  <https://sourceware.org/ml/gdb-patches/2017-06/msg00216.html>

On stringify_argv, we have to check if args[0] is not NULL before
stringifying anything, otherwise we might do the wrong thing when
trimming the "ret" string in the end.  args[0] will be NULL when no
arguments are passed to the inferior that will be started.

Checked in as obvious.

gdb/ChangeLog:
2017-06-08  Sergio Durigan Junior  <sergiodj@redhat.com>

	* common/common-utils.c (stringify_argv): Check for "arg[0] !=
	NULL".
2017-06-08 16:58:25 -04:00
..
agent.c
agent.h
ax.def
break-common.h
btrace-common.c
btrace-common.h
buffer.c
buffer.h
cleanups.c
cleanups.h
common-debug.c
common-debug.h
common-defs.h Poison non-POD memset & non-trivially-copyable memcpy/memmove 2017-04-25 01:46:19 +01:00
common-exceptions.c
common-exceptions.h DWARF-5: call sites 2017-02-20 21:00:55 +01:00
common-gdbthread.h Share parts of gdb/gdbthread.h with gdbserver 2017-06-07 19:56:01 -04:00
common-inferior.h Share fork_inferior et al with gdbserver 2017-06-07 19:56:09 -04:00
common-regcache.c
common-regcache.h
common-types.h
common-utils.c Fix possible bug when no args have been provided to the executable 2017-06-08 16:58:25 -04:00
common-utils.h Share fork_inferior et al with gdbserver 2017-06-07 19:56:09 -04:00
common.host
common.m4 Create gdb_termios.h (and cleanup gdb/{,gdbserver/}terminal.h) 2017-04-12 17:59:45 -04:00
create-version.sh
enum-flags.h Don't memcpy non-trivially-copyable types: Make enum_flags triv. copyable 2017-04-25 01:42:03 +01:00
environ.c Share gdb/environ.[ch] with gdbserver 2017-03-07 15:39:35 -05:00
environ.h Share gdb/environ.[ch] with gdbserver 2017-03-07 15:39:35 -05:00
errors.c
errors.h
fileio.c
fileio.h
filestuff.c
filestuff.h
format.c
format.h
function-view.h Poison non-POD memset & non-trivially-copyable memcpy/memmove 2017-04-25 01:46:19 +01:00
gdb_assert.h
gdb_locale.h
gdb_optional.h More gdb::optional features 2017-04-18 23:48:41 +01:00
gdb_ref_ptr.h Use class to manage BFD reference counts 2017-01-10 19:14:10 -07:00
gdb_setjmp.h
gdb_signals.h
gdb_sys_time.h
gdb_termios.h Create gdb_termios.h (and cleanup gdb/{,gdbserver/}terminal.h) 2017-04-12 17:59:45 -04:00
gdb_unique_ptr.h
gdb_unlinker.h gdb: Fix ATTRIBUTE_NONNULL usage 2017-03-08 15:52:16 +00:00
gdb_vecs.c
gdb_vecs.h Remove definition of VEC (CORE_ADDR) 2017-05-02 13:30:09 -04:00
gdb_wait.h
host-defs.h
job-control.c Move parts of inferior job control to common/ 2017-06-07 19:52:56 -04:00
job-control.h Move parts of inferior job control to common/ 2017-06-07 19:52:56 -04:00
mingw-strerror.c
new-op.c
offset-type.h Make sect_offset and cu_offset strong typedefs instead of structs 2017-04-04 20:03:26 +01:00
poison.h Fix build on gcc < 5 (std::is_trivially_copyable missing) 2017-04-25 10:58:57 +01:00
posix-strerror.c
preprocessor.h Make sect_offset and cu_offset strong typedefs instead of structs 2017-04-04 20:03:26 +01:00
print-utils.c -Wwrite-strings: The Rest 2017-04-05 19:21:37 +01:00
print-utils.h
ptid.c Class-ify ptid_t 2017-04-06 23:29:53 -04:00
ptid.h Class-ify ptid_t 2017-04-06 23:29:53 -04:00
queue.h
refcounted-object.h Fix removing inferiors from within "thread apply" commands 2017-04-19 13:12:23 +01:00
rsp-low.c
rsp-low.h
run-time-clock.c
run-time-clock.h
scoped_restore.h Make inferior::detaching a bool, and introduce scoped_restore::release() 2017-04-19 13:12:23 +01:00
signals-state-save-restore.c
signals-state-save-restore.h
signals.c
symbol.h
traits.h Fix build on gcc < 5 (std::is_trivially_copyable missing) 2017-04-25 10:58:57 +01:00
underlying.h dwarf2read.c: Make dir_index and file_name_index strong typedefs 2017-04-04 20:03:25 +01:00
valid-expr.h Make sect_offset and cu_offset strong typedefs instead of structs 2017-04-04 20:03:26 +01:00
vec.c
vec.h
version.h
x86-xstate.h Add support for Intel PKRU register to GDB and GDBserver. 2017-02-17 11:44:48 +01:00
xml-utils.c
xml-utils.h