summaryrefslogtreecommitdiff
path: root/mail/sendmail811/patches/patch-ah
diff options
context:
space:
mode:
Diffstat (limited to 'mail/sendmail811/patches/patch-ah')
-rw-r--r--mail/sendmail811/patches/patch-ah66
1 files changed, 66 insertions, 0 deletions
diff --git a/mail/sendmail811/patches/patch-ah b/mail/sendmail811/patches/patch-ah
new file mode 100644
index 00000000000..3815b4e40c8
--- /dev/null
+++ b/mail/sendmail811/patches/patch-ah
@@ -0,0 +1,66 @@
+$NetBSD: patch-ah,v 1.1 2003/09/18 17:10:37 taca Exp $
+
+--- sendmail/parseaddr.c.orig 2003-09-19 00:49:40.000000000 +0900
++++ sendmail/parseaddr.c
+@@ -645,7 +645,7 @@ int masklen;
+ }
+ #endif
+
+-#define NOCHAR -1 /* signal nothing in lookahead token */
++#define NOCHAR (-1) /* signal nothing in lookahead token */
+
+ char **
+ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
+@@ -731,22 +731,31 @@ prescan(addr, delim, pvpbuf, pvpbsize, d
+ /* see if there is room */
+ if (q >= &pvpbuf[pvpbsize - 5])
+ {
++ addrtoolong:
+ usrerr("553 5.1.1 Address too long");
+ if (strlen(addr) > (SIZE_T) MAXNAME)
+ addr[MAXNAME] = '\0';
+ returnnull:
+ if (delimptr != NULL)
++ {
++ if (p > addr)
++ --p;
+ *delimptr = p;
++ }
+ CurEnv->e_to = saveto;
+ return NULL;
+ }
+
+ /* squirrel it away */
++#if !ALLOW_255
++ if ((char) c == (char) -1 && !tTd(82, 101))
++ c &= 0x7f;
++#endif /* !ALLOW_255 */
+ *q++ = c;
+ }
+
+ /* read a new input character */
+- c = *p++;
++ c = (*p++) & 0x00ff;
+ if (c == '\0')
+ {
+ /* diagnose and patch up bad syntax */
+@@ -801,6 +810,9 @@ prescan(addr, delim, pvpbuf, pvpbsize, d
+ }
+ else if (c != '!' || state == QST)
+ {
++ /* see if there is room */
++ if (q >= &pvpbuf[pvpbsize - 5])
++ goto addrtoolong;
+ *q++ = '\\';
+ continue;
+ }
+@@ -885,6 +897,9 @@ prescan(addr, delim, pvpbuf, pvpbsize, d
+ /* new token */
+ if (tok != q)
+ {
++ /* see if there is room */
++ if (q >= &pvpbuf[pvpbsize - 5])
++ goto addrtoolong;
+ *q++ = '\0';
+ if (tTd(22, 36))
+ {