summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-02-26 04:36:58 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-02-26 04:36:58 +0000
commit6df7e20fe04243840b5e6a19b5b7958b996176ac (patch)
tree8784040ddd9c765f3154f16e021836f677812b85 /usr.sbin
parent567a630a379527b9f7c55d0c906cb95a37bbb490 (diff)
Zero out struct before using, not after.
From <sthen at symphytum dot spacehopper dot org>, PR 5388. OK hshoexer@ and mpf@.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sasyncd/sasyncd.c5
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);