diff options
author | 2019-08-23 12:09:41 +0000 | |
---|---|---|
committer | 2019-08-23 12:09:41 +0000 | |
commit | 3d2f1f8e4c91d06c402f847eda3d951252004af9 (patch) | |
tree | 11332e03bab4a764fc9129a3d40146372f654688 | |
parent | Default layout for disklabel(8) has changed, /usr became larger. (diff) | |
download | wireguard-openbsd-3d2f1f8e4c91d06c402f847eda3d951252004af9.tar.xz wireguard-openbsd-3d2f1f8e4c91d06c402f847eda3d951252004af9.zip |
martijn@ found a regression so revert to the old behavior for now
-rw-r--r-- | usr.sbin/smtpd/util.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/util.c b/usr.sbin/smtpd/util.c index 61a3e98985a..1ff713bd056 100644 --- a/usr.sbin/smtpd/util.c +++ b/usr.sbin/smtpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.145 2019/08/23 07:09:52 eric Exp $ */ +/* $OpenBSD: util.c,v 1.146 2019/08/23 12:09:41 eric Exp $ */ /* * Copyright (c) 2000,2001 Markus Friedl. All rights reserved. @@ -510,6 +510,7 @@ valid_domainpart(const char *s) struct in6_addr ina6; char *c, domain[SMTPD_MAXDOMAINPARTSIZE]; const char *p; + size_t dlen; if (*s == '[') { if (strncasecmp("[IPv6:", s, 6) == 0) @@ -534,7 +535,17 @@ valid_domainpart(const char *s) return 0; } - return valid_domainname(s); + if (*s == '\0') + return 0; + + dlen = strlen(s); + if (dlen >= sizeof domain) + return 0; + + if (s[dlen - 1] == '.') + return 0; + + return res_hnok(s); } #define charok(c) ((c) == '-' || (c) == '_' || isalpha((int)(c)) || isdigit((int)(c))) |