diff options
author | Gilles Chehade <gilles@dalenys.com> | 2016-02-02 19:21:40 +0100 |
---|---|---|
committer | Gilles Chehade <gilles@dalenys.com> | 2016-02-02 19:21:40 +0100 |
commit | 4f3d3586b9a379e4fc11646b912b03c0d76c3ea4 (patch) | |
tree | 92e3e1b4733496db054e53b0b214ba1be1577637 /smtpd/smtpd.h | |
parent | sync CVS/Entries (diff) | |
download | OpenSMTPD-4f3d3586b9a379e4fc11646b912b03c0d76c3ea4.tar.xz OpenSMTPD-4f3d3586b9a379e4fc11646b912b03c0d76c3ea4.zip |
- add checks for imsg data size
- various filters cleanups
Diffstat (limited to 'smtpd/smtpd.h')
-rw-r--r-- | smtpd/smtpd.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/smtpd/smtpd.h b/smtpd/smtpd.h index a74b51c0..f5397b55 100644 --- a/smtpd/smtpd.h +++ b/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.509 2016/01/04 13:30:20 jung Exp $ */ +/* $OpenBSD: smtpd.h,v 1.510 2016/01/27 12:46:03 sunil Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -29,6 +29,13 @@ #include "rfc2822.h" +#define CHECK_IMSG_DATA_SIZE(imsg, expected_sz) do { \ + if ((imsg)->hdr.len - IMSG_HEADER_SIZE != (expected_sz)) \ + fatalx("smtpd: imsg %d: data size expected %zd got %zd",\ + (imsg)->hdr.type, \ + (expected_sz), (imsg)->hdr.len - IMSG_HEADER_SIZE); \ +} while (0) + #define CONF_FILE "/etc/mail/smtpd.conf" #define MAILNAME_FILE "/etc/mail/mailname" #define CA_FILE "/etc/ssl/cert.pem" |