diff options
author | naddy <naddy@FreeBSD.org> | 2004-03-01 00:41:07 +0800 |
---|---|---|
committer | naddy <naddy@FreeBSD.org> | 2004-03-01 00:41:07 +0800 |
commit | 857d9eb82cb1c1075c6e573fe1d7004c1490a36d (patch) | |
tree | aa06832af2235900d45baad7d83b15ed99491372 /mail | |
parent | 6fee0b009cfee854cc566c3e77dff1bfc988f744 (diff) | |
download | freebsd-ports-gnome-857d9eb82cb1c1075c6e573fe1d7004c1490a36d.tar.gz freebsd-ports-gnome-857d9eb82cb1c1075c6e573fe1d7004c1490a36d.tar.zst freebsd-ports-gnome-857d9eb82cb1c1075c6e573fe1d7004c1490a36d.zip |
Fix incorrect buffer overflow fix: pass the size of the target
buffer rather than taking the size of the pointer.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/metamail/Makefile | 2 | ||||
-rw-r--r-- | mail/metamail/files/patch-ae | 49 |
2 files changed, 45 insertions, 6 deletions
diff --git a/mail/metamail/Makefile b/mail/metamail/Makefile index fe4f9458966d..fbc90ea886ab 100644 --- a/mail/metamail/Makefile +++ b/mail/metamail/Makefile @@ -7,7 +7,7 @@ PORTNAME= metamail PORTVERSION= 2.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= ftp://thumper.bellcore.com/pub/nsb/ DISTNAME= mm${PORTVERSION} diff --git a/mail/metamail/files/patch-ae b/mail/metamail/files/patch-ae index 3cfe25c60518..b2fa41111c6a 100644 --- a/mail/metamail/files/patch-ae +++ b/mail/metamail/files/patch-ae @@ -1,5 +1,5 @@ -*** metamail/splitmail.c.orig Mon Jan 31 16:23:14 1994 ---- metamail/splitmail.c Wed Feb 18 15:39:09 2004 +*** metamail/splitmail.c.orig Mon Jan 31 23:23:14 1994 +--- metamail/splitmail.c Sat Feb 28 19:17:32 2004 *************** *** 41,48 **** #define VERBOSEDELIVERYCMD VerboseDeliveryCmd @@ -20,6 +20,45 @@ usageexit() { *************** +*** 194,200 **** + s = endofheader(from); /* would be index(from, '\n'), + but need to check for continuation lines */ + *s = '\0'; +! if (ShareThisHeader(from, SubjectBuf, &OrigID)) { + strcat(SharedHeaders, from); + strcat(SharedHeaders, "\n"); + } +--- 194,200 ---- + s = endofheader(from); /* would be index(from, '\n'), + but need to check for continuation lines */ + *s = '\0'; +! if (ShareThisHeader(from, SubjectBuf, sizeof(SubjectBuf), &OrigID)) { + strcat(SharedHeaders, from); + strcat(SharedHeaders, "\n"); + } +*************** +*** 339,347 **** + NULL + }; + +! ShareThisHeader(s, SubjectBuf, OrigID) + char *s; + char *SubjectBuf; + char **OrigID; + { + int i; +--- 339,348 ---- + NULL + }; + +! ShareThisHeader(s, SubjectBuf, size, OrigID) + char *s; + char *SubjectBuf; ++ size_t size; + char **OrigID; + { + int i; +*************** *** 361,367 **** } if (!ULstrcmp(s, "subject")) { @@ -28,12 +67,12 @@ return(0); } if (!ULstrcmp(s, "content-type")) { ---- 361,368 ---- +--- 362,369 ---- } if (!ULstrcmp(s, "subject")) { *colon = ':'; -! strncpy(SubjectBuf, ++colon, sizeof(SubjectBuf)); -! SubjectBuf[sizeof(SubjectBuf) - 1] = '\0'; +! strncpy(SubjectBuf, ++colon, size); +! SubjectBuf[size - 1] = '\0'; return(0); } if (!ULstrcmp(s, "content-type")) { |