diff options
author | 2007-02-26 04:36:57 +0000 | |
---|---|---|
committer | 2007-02-26 04:36:57 +0000 | |
commit | f023e491e630b16e01825b6300ee5149ebef4e9d (patch) | |
tree | 6b03fa17f9a254af92b625b159d4a966eccdd989 | |
parent | This fixes the function names printed in the panic strings so that (diff) | |
download | wireguard-openbsd-f023e491e630b16e01825b6300ee5149ebef4e9d.tar.xz wireguard-openbsd-f023e491e630b16e01825b6300ee5149ebef4e9d.zip |
Zero out struct before using, not after.
From <sthen at symphytum dot spacehopper dot org>, PR 5388.
OK hshoexer@ and mpf@.
-rw-r--r-- | usr.sbin/sasyncd/sasyncd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/sasyncd/sasyncd.c b/usr.sbin/sasyncd/sasyncd.c index 7821a4065a6..2ee83d24028 100644 --- a/usr.sbin/sasyncd/sasyncd.c +++ b/usr.sbin/sasyncd/sasyncd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sasyncd.c,v 1.16 2006/12/26 00:58:11 msf Exp $ */ +/* $OpenBSD: sasyncd.c,v 1.17 2007/02/26 04:36:57 ray Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -153,6 +153,8 @@ main(int argc, char **argv) return 1; } + memset(&cfgstate, 0, sizeof cfgstate); + while ((ch = getopt(argc, argv, "c:dv")) != -1) { switch (ch) { case 'c': @@ -179,7 +181,6 @@ main(int argc, char **argv) log_init(__progname); timer_init(); - memset(&cfgstate, 0, sizeof cfgstate); cfgstate.runstate = INIT; LIST_INIT(&cfgstate.peerlist); |