diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2013-10-28 09:14:59 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2013-10-28 09:14:59 +0000 |
commit | 0eb87cf88e646afa31130d2940200b63fa3223c4 (patch) | |
tree | 1e24d6fed8dde1420a7333a8631c8ce4d643f203 /usr.sbin/smtpd | |
parent | bead6875efb84c446a2bcc88c05fb4e9a1e58366 (diff) |
bzero() some structs before using them, to be safe.
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/lka_session.c | 5 | ||||
-rw-r--r-- | usr.sbin/smtpd/mda.c | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/lka_session.c b/usr.sbin/smtpd/lka_session.c index e2d97819dbe..4fc3ba044a5 100644 --- a/usr.sbin/smtpd/lka_session.c +++ b/usr.sbin/smtpd/lka_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_session.c,v 1.58 2013/10/26 12:27:59 eric Exp $ */ +/* $OpenBSD: lka_session.c,v 1.59 2013/10/28 09:14:58 eric Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org> @@ -380,11 +380,14 @@ lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn) /* no aliases found, query forward file */ lks->rule = rule; lks->node = xn; + + bzero(&fwreq, sizeof(fwreq)); fwreq.id = lks->id; (void)strlcpy(fwreq.user, lk.userinfo.username, sizeof(fwreq.user)); (void)strlcpy(fwreq.directory, lk.userinfo.directory, sizeof(fwreq.directory)); fwreq.uid = lk.userinfo.uid; fwreq.gid = lk.userinfo.gid; + m_compose(p_parent, IMSG_PARENT_FORWARD_OPEN, 0, 0, -1, &fwreq, sizeof(fwreq)); lks->flags |= F_WAITING; diff --git a/usr.sbin/smtpd/mda.c b/usr.sbin/smtpd/mda.c index 4e3ab32dbfa..f7a7b495946 100644 --- a/usr.sbin/smtpd/mda.c +++ b/usr.sbin/smtpd/mda.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mda.c,v 1.96 2013/10/27 07:56:25 eric Exp $ */ +/* $OpenBSD: mda.c,v 1.97 2013/10/28 09:14:58 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -313,6 +313,7 @@ mda_imsg(struct mproc *p, struct imsg *imsg) /* request parent to fork a helper process */ userinfo = &s->user->userinfo; + bzero(&deliver, sizeof deliver); switch (e->method) { case A_MDA: deliver.mode = A_MDA; |