diff options
author | Kamil Rytarowski <n54@gmx.com> | 2020-09-23 04:20:05 +0200 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2020-10-02 00:38:12 +0200 |
commit | e2a2a24a8e78427ff8667d625f5befbe88c328bb (patch) | |
tree | a2cc2e7cd4bf621d7a18ecde02f77d1ceec9cd64 /gdbsupport/agent.cc | |
parent | 1eb6eb795fd3479c97d8aadc4f70d6afad5f8511 (diff) | |
download | fsf-binutils-gdb-e2a2a24a8e78427ff8667d625f5befbe88c328bb.zip fsf-binutils-gdb-e2a2a24a8e78427ff8667d625f5befbe88c328bb.tar.gz fsf-binutils-gdb-e2a2a24a8e78427ff8667d625f5befbe88c328bb.tar.bz2 |
Preinitialize the sockaddr_un variable to zero
Don't pass random sun_len for the BSD's,
zero the whole structure as recommended for portability.
Reported by Coverity.
gdbsupport/ChangeLog:
* agent.cc (gdb_connect_sync_socket): Preinitialize addr with zeros.
Diffstat (limited to 'gdbsupport/agent.cc')
-rw-r--r-- | gdbsupport/agent.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdbsupport/agent.cc b/gdbsupport/agent.cc index b4127ff..9588e1f 100644 --- a/gdbsupport/agent.cc +++ b/gdbsupport/agent.cc @@ -138,7 +138,7 @@ static int gdb_connect_sync_socket (int pid) { #ifdef HAVE_SYS_UN_H - struct sockaddr_un addr; + struct sockaddr_un addr = {}; int res, fd; char path[UNIX_PATH_MAX]; |