subroutines (this also adds $@ and $: features to subr calls); check
overflow of "tobuf" on smtp deliveries, which caused core dumps on
large mailing lists
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 3.114
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 3.57
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.200
# include "sendmail.h"
# include <sys/stat.h>
# include "sendmail.h"
# include <sys/stat.h>
-SCCSID(@(#)deliver.c 3.113 %G%);
+SCCSID(@(#)deliver.c 3.114 %G%);
/*
** DELIVER -- Deliver a message to a list of addresses.
/*
** DELIVER -- Deliver a message to a list of addresses.
register struct mailer *m; /* mailer for this recipient */
extern bool checkcompat();
char *pv[MAXPV+1];
register struct mailer *m; /* mailer for this recipient */
extern bool checkcompat();
char *pv[MAXPV+1];
- char tobuf[MAXLINE]; /* text line of to people */
+ char tobuf[MAXLINE-50]; /* text line of to people */
char buf[MAXNAME];
ADDRESS *ctladdr;
extern ADDRESS *getctladdr();
char buf[MAXNAME];
ADDRESS *ctladdr;
extern ADDRESS *getctladdr();
to->q_mailer != firstto->q_mailer)
continue;
to->q_mailer != firstto->q_mailer)
continue;
+ /* avoid overflowing tobuf */
+ if (sizeof tobuf - (strlen(to->q_paddr) + strlen(tobuf) + 1) < 0)
+ break;
+
# ifdef DEBUG
if (tTd(10, 1))
{
# ifdef DEBUG
if (tTd(10, 1))
{
-SCCSID(@(#)parseaddr.c 3.56 %G%);
+SCCSID(@(#)parseaddr.c 3.57 %G%);
/*
** PARSE -- Parse an address
/*
** PARSE -- Parse an address
- /* see if this is a "subroutine" call */
- if (*rp == CALLSUBR)
- {
- rp = *++rvp;
-# ifdef DEBUG
- if (tTd(21, 3))
- printf("-----callsubr %s\n", rp);
-# endif DEBUG
- rewrite(pvp, atoi(rp));
- rwr = rwr->r_next;
- continue;
- }
- else if (*rp == CANONUSER)
{
rvp++;
rwr = rwr->r_next;
{
rvp++;
rwr = rwr->r_next;
- bmove((char *) npvp, (char *) pvp, (avp - npvp) * sizeof *avp);
+ if (**npvp == CALLSUBR)
+ {
+ bmove((char *) &npvp[2], (char *) pvp,
+ (avp - npvp - 2) * sizeof *avp);
+# ifdef DEBUG
+ if (tTd(21, 3))
+ printf("-----callsubr %s\n", npvp[1]);
+# endif DEBUG
+ rewrite(pvp, atoi(npvp[1]));
+ }
+ else
+ {
+ bmove((char *) npvp, (char *) pvp,
+ (avp - npvp) * sizeof *avp);
+ }
# ifdef DEBUG
if (tTd(21, 4))
{
# ifdef DEBUG
if (tTd(21, 4))
{
-static char SccsId[] = "@(#)SendMail version 3.199 of %G%";
+static char SccsId[] = "@(#)SendMail version 3.200 of %G%";
-char Version[] = "3.199 [%G%]";
+char Version[] = "3.200 [%G%]";