diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-10-01 13:58:14 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-10-01 13:58:14 +0000 |
commit | ef347762e7b7bfe5f8cd2f9e5a9b8c8f84b874a6 (patch) | |
tree | 7bb3f9a788bb1847c4a52ed10130619892256542 /driver.c | |
parent | f1f91223732477be014979863d2c6786e1268ada (diff) | |
download | fetchmail-ef347762e7b7bfe5f8cd2f9e5a9b8c8f84b874a6.tar.gz fetchmail-ef347762e7b7bfe5f8cd2f9e5a9b8c8f84b874a6.tar.bz2 fetchmail-ef347762e7b7bfe5f8cd2f9e5a9b8c8f84b874a6.zip |
Prevent buffer overruns in the MDA command.
svn path=/trunk/; revision=1459
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -868,8 +868,13 @@ int num; /* index of message */ strcat(names, idp->id); strcat(names, " "); } - cmd = (char *)alloca(strlen(ctl->mda) + length); + length += strlen(ctl->mda); + cmd = (char *)alloca(length); +#ifdef SNPRINTF + snprintf(cmd, length, ctl->mda, names); +#else sprintf(cmd, ctl->mda, names); +#endif /* SNPRINTF */ if (outlevel == O_VERBOSE) error(0, 0, "about to deliver with: %s", cmd); |