From 42eddaeaf36d467074f329599193030c3beba8ba Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 20 Oct 1998 04:33:28 +0000 Subject: Make alloca safe. svn path=/trunk/; revision=2115 --- unmime.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'unmime.c') diff --git a/unmime.c b/unmime.c index 30eff6d4..2acc3f74 100644 --- a/unmime.c +++ b/unmime.c @@ -15,13 +15,6 @@ #include "config.h" #include #include -#if defined(HAVE_ALLOCA_H) -#include -#else -#ifdef _AIX - #pragma alloca -#endif -#endif #include #include "fetchmail.h" @@ -371,7 +364,7 @@ int MimeBodyType(unsigned char *hdrs, int WantDecode) XferEncOfs = NxtHdr; p = nxtaddr(NxtHdr); if (p != NULL) { - XferEnc = (char *)alloca(strlen(p) + 1); + xalloca(XferEnc, char *, strlen(p) + 1); strcpy(XferEnc, p); HdrsFound++; } @@ -402,7 +395,7 @@ int MimeBodyType(unsigned char *hdrs, int WantDecode) } while ( (p != NULL) && ((*(p+1) == '\t') || (*(p+1) == ' ')) ); if (p == NULL) p = NxtHdr + strlen(NxtHdr); - CntType = (char *)alloca(p-NxtHdr+2); + xalloca(CntType, char *, p-NxtHdr+2); strncpy(CntType, NxtHdr, (p-NxtHdr)); *(CntType+(p-NxtHdr)) = '\0'; HdrsFound++; @@ -410,7 +403,7 @@ int MimeBodyType(unsigned char *hdrs, int WantDecode) else if (strncasecmp("MIME-Version:", NxtHdr, 13) == 0) { p = nxtaddr(NxtHdr); if (p != NULL) { - MimeVer = (char *)alloca(strlen(p) + 1); + xalloca(MimeVer, char *, strlen(p) + 1); strcpy(MimeVer, p); HdrsFound++; } -- cgit v1.2.3