aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-01-18 00:41:15 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-01-18 00:41:15 +0000
commitdbe49c83c01b5ceef09419de09c0fbaed81cde4d (patch)
tree51206eaa85a797bc8ad420c1edaefa02aec120aa
parenta546045f506d777384ab802f8945e4a65405f612 (diff)
downloadfetchmail-dbe49c83c01b5ceef09419de09c0fbaed81cde4d.tar.gz
fetchmail-dbe49c83c01b5ceef09419de09c0fbaed81cde4d.tar.bz2
fetchmail-dbe49c83c01b5ceef09419de09c0fbaed81cde4d.zip
Prevent core dumps due to simultaneous use of %F and %T.
svn path=/trunk/; revision=1589
-rw-r--r--driver.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/driver.c b/driver.c
index 82e6f2a0..cbdad26b 100644
--- a/driver.c
+++ b/driver.c
@@ -923,7 +923,7 @@ int num; /* index of message */
if (idp->val.num == XMIT_ACCEPT)
length += (strlen(idp->id) + 1);
- names = (char *)alloca(++length);
+ names = (char *)xmalloc(++length);
names[0] = '\0';
for (idp = xmit_names; idp; idp = idp->next)
if (idp->val.num == XMIT_ACCEPT)
@@ -931,12 +931,13 @@ int num; /* index of message */
strcat(names, idp->id);
strcat(names, " ");
}
- after = (char *)alloca(length);
+ after = (char *)xmalloc(length);
#ifdef SNPRINTF
snprintf(after, length, before, names);
#else
sprintf(after, before, names);
#endif /* SNPRINTF */
+ free(names);
free(before);
before = after;
@@ -957,7 +958,7 @@ int num; /* index of message */
*sp = '\177';
length += strlen(from);
- after = alloca(length);
+ after = (char *)xmalloc(length);
cp[1] = 's';
#ifdef SNPRINTF
snprintf(after, length, before, from);
@@ -986,6 +987,7 @@ int num; /* index of message */
#endif /* HAVE_SETEUID */
sinkfp = popen(before, "w");
+ free(before);
#ifdef HAVE_SETEUID
/* this will fail quietly if we didn't start as root */