patch-src_metamail_splitmail_c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. $OpenBSD: patch-src_metamail_splitmail_c,v 1.1 2012/03/17 10:57:23 sthen Exp $
  2. --- src/metamail/splitmail.c.orig Mon Jan 31 22:23:14 1994
  3. +++ src/metamail/splitmail.c Sat Mar 17 10:51:52 2012
  4. @@ -21,6 +21,8 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  5. ******************************************************* */
  6. #include <stdio.h>
  7. +#include <stdlib.h>
  8. +#include <string.h>
  9. #include <sys/types.h>
  10. #include <sys/stat.h>
  11. #include <config.h>
  12. @@ -28,7 +30,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  13. #include <time.h>
  14. #define MINCHUNKSIZE 20000 /* Better be enough to hold the headers, or we die! */
  15. -extern char *malloc(), *index(), *getmyname();
  16. +extern char *getmyname();
  17. #ifdef AMIGA
  18. #define Prototype extern
  19. @@ -40,9 +42,8 @@ extern char *malloc(), *index(), *getmyname();
  20. #define NORMALDELIVERYCMD NormalDeliveryCmd
  21. #define VERBOSEDELIVERYCMD VerboseDeliveryCmd
  22. #else
  23. -extern char *getenv();
  24. -#define NORMALDELIVERYCMD "/usr/lib/sendmail -t -oi"
  25. -#define VERBOSEDELIVERYCMD "/usr/lib/sendmail -t -v -oi"
  26. +#define NORMALDELIVERYCMD "/usr/sbin/sendmail -t -oi"
  27. +#define VERBOSEDELIVERYCMD "/usr/sbin/sendmail -t -v -oi"
  28. #endif
  29. usageexit() {
  30. @@ -194,7 +195,7 @@ char **argv;
  31. s = endofheader(from); /* would be index(from, '\n'),
  32. but need to check for continuation lines */
  33. *s = '\0';
  34. - if (ShareThisHeader(from, SubjectBuf, &OrigID)) {
  35. + if (ShareThisHeader(from, SubjectBuf, sizeof(SubjectBuf), &OrigID)) {
  36. strcat(SharedHeaders, from);
  37. strcat(SharedHeaders, "\n");
  38. }
  39. @@ -339,9 +340,10 @@ static char *SharedHeads[] = {
  40. NULL
  41. };
  42. -ShareThisHeader(s, SubjectBuf, OrigID)
  43. +ShareThisHeader(s, SubjectBuf, size, OrigID)
  44. char *s;
  45. char *SubjectBuf;
  46. +size_t size;
  47. char **OrigID;
  48. {
  49. int i;
  50. @@ -361,7 +363,7 @@ char **OrigID;
  51. }
  52. if (!ULstrcmp(s, "subject")) {
  53. *colon = ':';
  54. - strcpy(SubjectBuf, ++colon);
  55. + strlcpy(SubjectBuf, ++colon, size);
  56. return(0);
  57. }
  58. if (!ULstrcmp(s, "content-type")) {