aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-10-01 13:58:14 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-10-01 13:58:14 +0000
commitef347762e7b7bfe5f8cd2f9e5a9b8c8f84b874a6 (patch)
tree7bb3f9a788bb1847c4a52ed10130619892256542 /driver.c
parentf1f91223732477be014979863d2c6786e1268ada (diff)
downloadfetchmail-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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/driver.c b/driver.c
index 86622068..3032433e 100644
--- a/driver.c
+++ b/driver.c
@@ -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);