diff options
author | kim <kim> | 1999-03-07 19:40:01 +0000 |
---|---|---|
committer | kim <kim> | 1999-03-07 19:40:01 +0000 |
commit | 8680e5d53f78b7e2185afc0708125722145fe37f (patch) | |
tree | 6d785b1351b09298892c596f7e1270162a9a2ea6 /mail | |
parent | 0d534a122e4bc9ee7b71aa176ce3f8adb719cd72 (diff) | |
download | pkgsrc-8680e5d53f78b7e2185afc0708125722145fe37f.tar.gz |
Fix buffer overflow problems in m_getfld.c
Diffstat (limited to 'mail')
-rw-r--r-- | mail/nmh/patches/patch-cf | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/nmh/patches/patch-cf b/mail/nmh/patches/patch-cf new file mode 100644 index 00000000000..cbc7b644a1e --- /dev/null +++ b/mail/nmh/patches/patch-cf @@ -0,0 +1,31 @@ +$NetBSD: patch-cf,v 1.1 1999/03/07 19:40:01 kim Exp $ + +--- sbr/m_getfld.c.orig Fri Jul 31 18:48:37 1998 ++++ sbr/m_getfld.c Sun Mar 7 14:33:11 1999 +@@ -259,7 +259,7 @@ + bp = sp = (unsigned char *) iob->_ptr - 1; + j = (cnt = iob->_cnt+1) < i ? cnt : i; + #endif +- while ((c = *bp++) != ':' && c != '\n' && --j >= 0) ++ while (--j >= 0 && (c = *bp++) != ':' && c != '\n') + *cp++ = c; + + j = bp - sp; +@@ -538,7 +538,7 @@ + ; + #else /* RPATHS */ + cp = unixbuf; +- while ((c = getc (iob)) != '\n') ++ while ((c = getc (iob)) != '\n' && cp - unixbuf < BUFSIZ - 1) + *cp++ = c; + *cp = 0; + #endif /* RPATHS */ +@@ -639,7 +639,7 @@ + break; + #else /* RPATHS */ + cp = unixbuf; +- while ((c = getc (iob)) != '\n' && c >= 0) ++ while ((c = getc (iob)) != '\n' && c >= 0 && cp - unixbuf < BUFSIZ - 1) + *cp++ = c; + *cp = 0; + #endif /* RPATHS */ |