summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/mda.c
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@cvs.openbsd.org>2016-02-02 05:45:28 +0000
committerSunil Nimmagadda <sunil@cvs.openbsd.org>2016-02-02 05:45:28 +0000
commite30b634993012c54d17bfbb3389f21e1f9c59090 (patch)
tree88fef8e88cc8d237013e541b52d032d132c68c50 /usr.sbin/smtpd/mda.c
parent69c004aabfba5ee33b41308537cee4457545a41a (diff)
Check imsg data size before use.
Ok eric@ millert@
Diffstat (limited to 'usr.sbin/smtpd/mda.c')
-rw-r--r--usr.sbin/smtpd/mda.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/mda.c b/usr.sbin/smtpd/mda.c
index 5d5f9b573ab..c99d1404a35 100644
--- a/usr.sbin/smtpd/mda.c
+++ b/usr.sbin/smtpd/mda.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mda.c,v 1.116 2016/01/08 19:31:29 chrisz Exp $ */
+/* $OpenBSD: mda.c,v 1.117 2016/02/02 05:45:27 sunil Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -149,6 +149,8 @@ mda_imsg(struct mproc *p, struct imsg *imsg)
"Permanent failure in user lookup",
ESC_DESTINATION_MAILBOX_HAS_MOVED);
else {
+ if (sz != sizeof(u->userinfo))
+ fatalx("mda: userinfo size mismatch");
memmove(&u->userinfo, data, sz);
u->flags &= ~USER_WAITINFO;
u->flags |= USER_RUNNABLE;