diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/mda.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mda.c b/usr.sbin/smtpd/mda.c index 0d6d38823d9..606c42e2d4c 100644 --- a/usr.sbin/smtpd/mda.c +++ b/usr.sbin/smtpd/mda.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mda.c,v 1.113 2015/11/30 12:26:55 sunil Exp $ */ +/* $OpenBSD: mda.c,v 1.114 2015/11/30 13:10:13 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -281,8 +281,17 @@ mda_imsg(struct mproc *p, struct imsg *imsg) deliver.userinfo = *userinfo; (void)strlcpy(deliver.user, userinfo->username, sizeof(deliver.user)); - (void)strlcpy(deliver.to, e->buffer, - sizeof(deliver.to)); + if (strlcpy(deliver.to, e->buffer, + sizeof(deliver.to)) + >= sizeof(deliver.to)) { + mda_queue_tempfail(e->id, + "mda command too long", + ESC_OTHER_MAIL_SYSTEM_STATUS); + mda_log(e, "TempFail", + "mda command too long"); + mda_done(s); + return; + } break; case A_MBOX: |