Skip to content

Commit

Permalink
tests/qtest/ipmi-bt-test: Zero-initialize sockaddr struct
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-id: 20210813150506.7768-4-peter.maydell@linaro.org
  • Loading branch information
pm215 committed Aug 26, 2021
1 parent fdcdf54 commit a8ca003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/qtest/ipmi-bt-test.c
Expand Up @@ -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;
Expand Down

0 comments on commit a8ca003

Please sign in to comment.