summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sendmail/src/recipient.c
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1995-02-23 00:20:00 +0000
committerpst <pst@FreeBSD.org>1995-02-23 00:20:00 +0000
commit37063bd4edb87b70b019d35bddf18209ab478c44 (patch)
treec2ec59123a60e285b451f58acfbedc78a4aab7f2 /usr.sbin/sendmail/src/recipient.c
parentbabe0fd0e29aedfa2e1d473fbb3dcec915a3b575 (diff)
downloadFreeBSD-src-37063bd4edb87b70b019d35bddf18209ab478c44.zip
FreeBSD-src-37063bd4edb87b70b019d35bddf18209ab478c44.tar.gz
Sendmail 8.6.10 update for security problems.
Imported on CSRG/V_8_6_10 branch. Obtained from: CSRG/Allman
Diffstat (limited to 'usr.sbin/sendmail/src/recipient.c')
-rw-r--r--usr.sbin/sendmail/src/recipient.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/sendmail/src/recipient.c b/usr.sbin/sendmail/src/recipient.c
index c6c15c4..0820e60 100644
--- a/usr.sbin/sendmail/src/recipient.c
+++ b/usr.sbin/sendmail/src/recipient.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)recipient.c 8.44 (Berkeley) 2/28/94";
+static char sccsid[] = "@(#)recipient.c 8.44.1.4 (Berkeley) 2/20/95";
#endif /* not lint */
# include "sendmail.h"
@@ -75,7 +75,10 @@ sendtolist(list, ctladdr, sendq, e)
bool firstone; /* set on first address sent */
char delimiter; /* the address delimiter */
int naddrs;
+ int i;
char *oldto = e->e_to;
+ char *bufp;
+ char buf[MAXNAME + 1];
if (list == NULL)
{
@@ -102,7 +105,15 @@ sendtolist(list, ctladdr, sendq, e)
al = NULL;
naddrs = 0;
- for (p = list; *p != '\0'; )
+ /* make sure we have enough space to copy the string */
+ i = strlen(list) + 1;
+ if (i <= sizeof buf)
+ bufp = buf;
+ else
+ bufp = xalloc(i);
+ strcpy(bufp, denlstring(list));
+
+ for (p = bufp; *p != '\0'; )
{
auto char *delimptr;
register ADDRESS *a;
@@ -143,6 +154,8 @@ sendtolist(list, ctladdr, sendq, e)
}
e->e_to = oldto;
+ if (bufp != buf)
+ free(bufp);
return (naddrs);
}
/*
OpenPOWER on IntegriCloud