Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kamil Rytarowski <n54@gmx.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/5] Preinitialize the sockaddr_un variable to zero
Date: Wed, 23 Sep 2020 06:25:12 +0200	[thread overview]
Message-ID: <20200923042515.28245-3-n54@gmx.com> (raw)
In-Reply-To: <20200923042515.28245-1-n54@gmx.com>

Fix portability issue as passing random sun_len is not portable.

gdbsupport/ChangeLog:

	* agent.cc (gdb_connect_sync_socket): Preinitialize addr with zeros.
---
 gdbsupport/ChangeLog | 4 ++++
 gdbsupport/agent.cc  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog
index d46f8c77bb0..36961c90cfd 100644
--- a/gdbsupport/ChangeLog
+++ b/gdbsupport/ChangeLog
@@ -1,3 +1,7 @@
+2020-09-23  Kamil Rytarowski  <n54@gmx.com>
+
+	* agent.cc (gdb_connect_sync_socket): Preinitialize addr with zeros.
+
 2020-09-16  John Baldwin  <jhb@FreeBSD.org>

 	* common.m4 (GDB_AC_COMMON): Refactor checks for kinfo_getfile().
diff --git a/gdbsupport/agent.cc b/gdbsupport/agent.cc
index b4127ff6baf..9588e1ff309 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];

--
2.28.0


  parent reply	other threads:[~2020-09-23  4:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  4:25 [PATCH 0/5] Refine the NetBSD support Kamil Rytarowski
2020-09-23  4:25 ` [PATCH 1/5] Include the x86-bsd-nat.h header and fix the NetBSD/i386 build Kamil Rytarowski
2020-09-23 13:15   ` Christian Biesinger via Gdb-patches
2020-09-23 13:29     ` Kamil Rytarowski
2020-09-28 20:52       ` Simon Marchi
2020-09-23 19:46     ` John Baldwin
2020-09-23  4:25 ` Kamil Rytarowski [this message]
2020-09-28 20:57   ` [PATCH 2/5] Preinitialize the sockaddr_un variable to zero Simon Marchi
2020-09-23  4:25 ` [PATCH 3/5] Refactor the NetBSD amd64 gdbserver support Kamil Rytarowski
2020-09-28 21:11   ` Simon Marchi
2020-09-23  4:25 ` [PATCH 4/5] Add NetBSD/i386 " Kamil Rytarowski
2020-09-23  4:25 ` [PATCH 5/5] Remove the old sanity check of sigcontext offsets for NetBSD/i386 Kamil Rytarowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200923042515.28245-3-n54@gmx.com \
    --to=n54@gmx.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox