qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Corey Minyard" <minyard@acm.org>
Subject: [PATCH for-6.2 3/4] tests/qtest/ipmi-bt-test: Zero-initialize sockaddr struct
Date: Fri, 13 Aug 2021 16:05:05 +0100	[thread overview]
Message-ID: <20210813150506.7768-4-peter.maydell@linaro.org> (raw)
In-Reply-To: <20210813150506.7768-1-peter.maydell@linaro.org>

Zero-initialize the sockaddr_in struct that we're about to fill in
and pass to bind(), to ensure we don't leave possible
implementation-defined extension fields as uninitialized garbage.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 tests/qtest/ipmi-bt-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/ipmi-bt-test.c b/tests/qtest/ipmi-bt-test.c
index 8492f02a9c3..19612e9405a 100644
--- a/tests/qtest/ipmi-bt-test.c
+++ b/tests/qtest/ipmi-bt-test.c
@@ -378,7 +378,7 @@ static void test_enable_irq(void)
  */
 static void open_socket(void)
 {
-    struct sockaddr_in myaddr;
+    struct sockaddr_in myaddr = {};
     socklen_t addrlen;
 
     myaddr.sin_family = AF_INET;
-- 
2.20.1



  parent reply	other threads:[~2021-08-13 15:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13 15:05 [PATCH for-6.2 0/4] Zero sockaddr_in when initializing it Peter Maydell
2021-08-13 15:05 ` [PATCH for-6.2 1/4] net: Zero sockaddr_in in parse_host_port() Peter Maydell
2021-08-13 18:34   ` Eric Blake
2021-08-13 15:05 ` [PATCH for-6.2 2/4] gdbstub: Zero-initialize sockaddr structs Peter Maydell
2021-08-13 18:37   ` Eric Blake
2021-08-13 15:05 ` Peter Maydell [this message]
2021-08-13 18:38   ` [PATCH for-6.2 3/4] tests/qtest/ipmi-bt-test: Zero-initialize sockaddr struct Eric Blake
2021-08-14  6:41   ` Thomas Huth
2021-08-14 15:46   ` Corey Minyard
2021-08-13 15:05 ` [PATCH for-6.2 4/4] tests/tcg/multiarch/linux-test: Zero-initialize sockaddr structs Peter Maydell
2021-08-13 18:39   ` Eric Blake
2021-08-13 18:30 ` [PATCH for-6.2 0/4] Zero sockaddr_in when initializing it Eric Blake
2021-08-15 14:34   ` Philippe Mathieu-Daudé
2021-08-15 15:44     ` Peter Maydell
2021-08-15 16:13       ` Philippe Mathieu-Daudé
2021-08-26 14:34 ` Peter Maydell

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=20210813150506.7768-4-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=eblake@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=minyard@acm.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).