diff options
author | Gary Benson <gbenson@redhat.com> | 2015-04-14 12:35:30 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2015-04-14 12:35:30 +0100 |
commit | 326a5c7e368d49251ad48b2091388d8f424bfc54 (patch) | |
tree | 0562478dab7f4c421f411a154b1b526df40e4498 /gdb/jit.c | |
parent | 889c2a67967f7047c245779a0a0fd8ba8796846e (diff) | |
download | gdb-326a5c7e368d49251ad48b2091388d8f424bfc54.zip gdb-326a5c7e368d49251ad48b2091388d8f424bfc54.tar.gz gdb-326a5c7e368d49251ad48b2091388d8f424bfc54.tar.bz2 |
Zero supplied stat buffers in functions that pretend to stat
GDB has five places where it pretends to stat for bfd_openr_iovec.
Four of these only set the incoming buffer's st_size, leaving the
other fields unchanged, which is to say very likely populated with
random values from the stack. remote_bfd_iovec_stat was fixed in
0a93529c56714b1da3d7106d3e0300764f8bb81c; this commit fixes the
other four.
gdb/ChangeLog:
* jit.c (mem_bfd_iovec_stat): Zero supplied buffer.
* minidebug.c (lzma_stat): Likewise.
* solib-spu.c (spu_bfd_iovec_stat): Likewise.
* spu-linux-nat.c (spu_bfd_iovec_stat): Likewise.
Diffstat (limited to 'gdb/jit.c')
-rw-r--r-- | gdb/jit.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -126,6 +126,7 @@ mem_bfd_iovec_stat (struct bfd *abfd, void *stream, struct stat *sb) { struct target_buffer *buffer = (struct target_buffer*) stream; + memset (sb, 0, sizeof (struct stat)); sb->st_size = buffer->size; return 0; } |