diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-01-18 00:41:15 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-01-18 00:41:15 +0000 |
commit | dbe49c83c01b5ceef09419de09c0fbaed81cde4d (patch) | |
tree | 51206eaa85a797bc8ad420c1edaefa02aec120aa | |
parent | a546045f506d777384ab802f8945e4a65405f612 (diff) | |
download | fetchmail-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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 */ |