12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- $OpenBSD: patch-src_metamail_splitmail_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
- --- src/metamail/splitmail.c.orig Mon Jan 31 22:23:14 1994
- +++ src/metamail/splitmail.c Sat Mar 17 10:51:52 2012
- @@ -21,6 +21,8 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
- ******************************************************* */
-
- #include <stdio.h>
- +#include <stdlib.h>
- +#include <string.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <config.h>
- @@ -28,7 +30,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
- #include <time.h>
-
- #define MINCHUNKSIZE 20000 /* Better be enough to hold the headers, or we die! */
- -extern char *malloc(), *index(), *getmyname();
- +extern char *getmyname();
-
- #ifdef AMIGA
- #define Prototype extern
- @@ -40,9 +42,8 @@ extern char *malloc(), *index(), *getmyname();
- #define NORMALDELIVERYCMD NormalDeliveryCmd
- #define VERBOSEDELIVERYCMD VerboseDeliveryCmd
- #else
- -extern char *getenv();
- -#define NORMALDELIVERYCMD "/usr/lib/sendmail -t -oi"
- -#define VERBOSEDELIVERYCMD "/usr/lib/sendmail -t -v -oi"
- +#define NORMALDELIVERYCMD "/usr/sbin/sendmail -t -oi"
- +#define VERBOSEDELIVERYCMD "/usr/sbin/sendmail -t -v -oi"
- #endif
-
- usageexit() {
- @@ -194,7 +195,7 @@ char **argv;
- s = endofheader(from); /* would be index(from, '\n'),
- but need to check for continuation lines */
- *s = '\0';
- - if (ShareThisHeader(from, SubjectBuf, &OrigID)) {
- + if (ShareThisHeader(from, SubjectBuf, sizeof(SubjectBuf), &OrigID)) {
- strcat(SharedHeaders, from);
- strcat(SharedHeaders, "\n");
- }
- @@ -339,9 +340,10 @@ static char *SharedHeads[] = {
- NULL
- };
-
- -ShareThisHeader(s, SubjectBuf, OrigID)
- +ShareThisHeader(s, SubjectBuf, size, OrigID)
- char *s;
- char *SubjectBuf;
- +size_t size;
- char **OrigID;
- {
- int i;
- @@ -361,7 +363,7 @@ char **OrigID;
- }
- if (!ULstrcmp(s, "subject")) {
- *colon = ':';
- - strcpy(SubjectBuf, ++colon);
- + strlcpy(SubjectBuf, ++colon, size);
- return(0);
- }
- if (!ULstrcmp(s, "content-type")) {
|