diff options
author | 2014-07-19 18:11:12 +0000 | |
---|---|---|
committer | 2014-07-19 18:11:12 +0000 | |
commit | b3363b6ba57a3b9f68afca49ecf3267598f71e59 (patch) | |
tree | 92b7f2c4deff35057967ab6ba5d4256782509a34 | |
parent | Bring back pci_dopm, but disable it before powerdown. (diff) | |
download | wireguard-openbsd-b3363b6ba57a3b9f68afca49ecf3267598f71e59.tar.xz wireguard-openbsd-b3363b6ba57a3b9f68afca49ecf3267598f71e59.zip |
Make sure struct sockaddr_in gets completely initialized by setting it to zero
before setting the few fields we are interested in; Doug Hogan
-rw-r--r-- | regress/sys/kern/rcvtimeo/rcvtimeo.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/regress/sys/kern/rcvtimeo/rcvtimeo.c b/regress/sys/kern/rcvtimeo/rcvtimeo.c index 2dcb00fe947..72d22835852 100644 --- a/regress/sys/kern/rcvtimeo/rcvtimeo.c +++ b/regress/sys/kern/rcvtimeo/rcvtimeo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcvtimeo.c,v 1.4 2003/09/02 23:52:17 david Exp $ */ +/* $OpenBSD: rcvtimeo.c,v 1.5 2014/07/19 18:11:12 miod Exp $ */ /* Written by Michael Shalayeff, 2002, Public Domain */ @@ -11,6 +11,7 @@ #include <unistd.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <errno.h> #include <err.h> @@ -40,6 +41,7 @@ main(int argc, char *argv[]) if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) err(1, "socket"); + memset(&sin, 0, sizeof(sin)); sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; sin.sin_port = htons(30000); /* XXX assuming nothing is there */ |