1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

Fix incorrect buffer overflow fix: pass the size of the target

buffer rather than taking the size of the pointer.
This commit is contained in:
Christian Weisgerber 2004-02-29 16:41:07 +00:00
parent 819d9c1244
commit d110f60435
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=102549
2 changed files with 45 additions and 6 deletions

View File

@ -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}

View File

@ -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")) {