SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 8.37
SCCS-vsn: usr.sbin/sendmail/src/headers.c 8.49
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 8.72
SCCS-vsn: usr.sbin/sendmail/src/macro.c 8.9
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 8.57
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 8.55
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 8.73
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.129
SCCS-vsn: usr.sbin/sendmail/src/queue.c 8.67
SCCS-vsn: usr.sbin/sendmail/src/alias.c 8.38
SCCS-vsn: usr.sbin/sendmail/src/map.c 8.50
# include <pwd.h>
#ifndef lint
# include <pwd.h>
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.37 (Berkeley) %G%";
+static char sccsid[] = "@(#)alias.c 8.38 (Berkeley) %G%";
bool attimeout = FALSE;
time_t mtime;
struct stat stb;
bool attimeout = FALSE;
time_t mtime;
struct stat stb;
if (tTd(27, 3))
printf("aliaswait(%s:%s)\n",
if (tTd(27, 3))
printf("aliaswait(%s:%s)\n",
#ifndef lint
#ifdef DAEMON
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.72 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.73 (Berkeley) %G% (with daemon mode)";
-static char sccsid[] = "@(#)daemon.c 8.72 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.73 (Berkeley) %G% (without daemon mode)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
struct in_addr in_addr;
char *cp;
register STAB *s;
struct in_addr in_addr;
char *cp;
register STAB *s;
+ char hbuf[MAXNAME + 1];
extern struct hostent *gethostbyaddr();
#if NAMED_BIND
extern int h_errno;
extern struct hostent *gethostbyaddr();
#if NAMED_BIND
extern int h_errno;
if (tTd(9, 1))
printf("host_map_lookup(%s) => ", name);
s->s_namecanon.nc_flags |= NCF_VALID; /* will be soon */
if (tTd(9, 1))
printf("host_map_lookup(%s) => ", name);
s->s_namecanon.nc_flags |= NCF_VALID; /* will be soon */
- (void) strcpy(hbuf, name);
+ if (strlen(name) < sizeof hbuf)
+ (void) strcpy(hbuf, name);
+ else
+ {
+ bcopy(name, hbuf, sizeof hbuf - 1);
+ hbuf[sizeof hbuf - 1] = '\0';
+ }
if (getcanonname(hbuf, sizeof hbuf - 1, TRUE))
{
if (tTd(9, 1))
if (getcanonname(hbuf, sizeof hbuf - 1, TRUE))
{
if (tTd(9, 1))
-static char sccsid[] = "@(#)deliver.c 8.128 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 8.129 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
int rpvect[2];
char *pv[MAXPV+1];
char tobuf[TOBUFSIZE]; /* text line of to people */
int rpvect[2];
char *pv[MAXPV+1];
char tobuf[TOBUFSIZE]; /* text line of to people */
- char buf[MAXNAME];
- char rpathbuf[MAXNAME]; /* translated return path */
+ char buf[MAXNAME + 1];
+ char rpathbuf[MAXNAME + 1]; /* translated return path */
extern int checkcompat();
errno = 0;
extern int checkcompat();
errno = 0;
break;
/* this entry is safe -- go ahead and process it */
break;
/* this entry is safe -- go ahead and process it */
- expand(*mvp, buf, &buf[sizeof buf - 1], e);
+ expand(*mvp, buf, &buf[sizeof buf], e);
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV - 3])
{
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV - 3])
{
- expand(*mvp, buf, &buf[sizeof buf - 1], e);
+ expand(*mvp, buf, &buf[sizeof buf], e);
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV - 2])
{
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV - 2])
{
while (!clever && *++mvp != NULL)
{
while (!clever && *++mvp != NULL)
{
- expand(*mvp, buf, &buf[sizeof buf - 1], e);
+ expand(*mvp, buf, &buf[sizeof buf], e);
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV])
syserr("554 deliver: pv overflow after $u for %s", pv[0]);
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV])
syserr("554 deliver: pv overflow after $u for %s", pv[0]);
while (*curhost != '\0')
{
register char *p;
while (*curhost != '\0')
{
register char *p;
- static char hostbuf[MAXNAME];
+ static char hostbuf[MAXNAME + 1];
/* pull the next host from the signature */
p = strchr(curhost, ':');
/* pull the next host from the signature */
p = strchr(curhost, ':');
if (m->m_execdir != NULL)
{
char *p, *q;
if (m->m_execdir != NULL)
{
char *p, *q;
for (p = m->m_execdir; p != NULL; p = q)
{
q = strchr(p, ':');
if (q != NULL)
*q = '\0';
for (p = m->m_execdir; p != NULL; p = q)
{
q = strchr(p, ':');
if (q != NULL)
*q = '\0';
- expand(p, buf, &buf[sizeof buf] - 1, e);
+ expand(p, buf, &buf[sizeof buf], e);
if (q != NULL)
*q++ = ':';
if (tTd(11, 20))
if (q != NULL)
*q++ = ':';
if (tTd(11, 20))
-static char sccsid[] = "@(#)headers.c 8.48 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c 8.49 (Berkeley) %G%";
#endif /* not lint */
# include <errno.h>
#endif /* not lint */
# include <errno.h>
struct hdrinfo *hi;
bool cond = FALSE;
BITMAP mopts;
struct hdrinfo *hi;
bool cond = FALSE;
BITMAP mopts;
extern ADDRESS *sendto();
if (tTd(31, 6))
extern ADDRESS *sendto();
if (tTd(31, 6))
register char *sbp;
register char *p;
int l;
register char *sbp;
register char *p;
int l;
- char hbuf[MAXNAME];
- char sbuf[MAXLINE];
- char mbuf[MAXNAME];
+ char hbuf[MAXNAME + 1];
+ char sbuf[MAXLINE + 1];
+ char mbuf[MAXNAME + 1];
/* don't allow newlines in the message-id */
if (msgid != NULL)
/* don't allow newlines in the message-id */
if (msgid != NULL)
bool gotangle = FALSE;
register char *bp;
char *buflim;
bool gotangle = FALSE;
register char *bp;
char *buflim;
- static char buf[MAXNAME];
+ static char buf[MAXNAME + 1];
if (tTd(33, 1))
printf("crackaddr(%s)\n", addr);
if (tTd(33, 1))
printf("crackaddr(%s)\n", addr);
-static char sccsid[] = "@(#)macro.c 8.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)macro.c 8.9 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
** s -- the string to expand.
** buf -- the place to put the expansion.
** buflim -- the buffer limit, i.e., the address
** s -- the string to expand.
** buf -- the place to put the expansion.
** buflim -- the buffer limit, i.e., the address
-** of the last usable position in buf.
+** of the first byte after buf.
** e -- envelope in which to work.
**
** Returns:
** e -- envelope in which to work.
**
** Returns:
-static char sccsid[] = "@(#)map.c 8.49 (Berkeley) %G%";
+static char sccsid[] = "@(#)map.c 8.50 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
int omode;
int fd;
struct stat st;
int omode;
int fd;
struct stat st;
if (tTd(38, 2))
printf("bt_map_open(%s, %s, %d)\n",
if (tTd(38, 2))
printf("bt_map_open(%s, %s, %d)\n",
int omode;
int fd;
struct stat st;
int omode;
int fd;
struct stat st;
if (tTd(38, 2))
printf("hash_map_open(%s, %s, %d)\n",
if (tTd(38, 2))
printf("hash_map_open(%s, %s, %d)\n",
char *
nisplus_default_domain()
{
char *
nisplus_default_domain()
{
- static char default_domain[MAXNAME] = "";
+ static char default_domain[MAXNAME + 1] = "";
char *p;
if (default_domain[0] != '\0')
char *p;
if (default_domain[0] != '\0')
char search_key[MAXNAME + 1];
char linebuf[MAXLINE];
FILE *f;
char search_key[MAXNAME + 1];
char linebuf[MAXLINE];
FILE *f;
char delim;
int key_idx;
bool found_it;
char delim;
int key_idx;
bool found_it;
-static char sccsid[] = "@(#)parseaddr.c 8.56 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c 8.57 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
int spaceleft;
static MAILER errormailer;
static char *errorargv[] = { "ERROR", NULL };
int spaceleft;
static MAILER errormailer;
static char *errorargv[] = { "ERROR", NULL };
- static char buf[MAXNAME];
+ static char buf[MAXNAME + 1];
char *fancy;
char *oldg = macvalue('g', e);
int rwset;
char *fancy;
char *oldg = macvalue('g', e);
int rwset;
- static char buf[MAXNAME];
- char lbuf[MAXNAME];
+ static char buf[MAXNAME + 1];
+ char lbuf[MAXNAME + 1];
char pvpbuf[PSBUFSIZE];
if (tTd(12, 1))
char pvpbuf[PSBUFSIZE];
if (tTd(12, 1))
/* need to make sure route-addrs have <angle brackets> */
if (bitset(RF_CANONICAL, flags) && lbuf[0] == '@')
/* need to make sure route-addrs have <angle brackets> */
if (bitset(RF_CANONICAL, flags) && lbuf[0] == '@')
- expand("<\201g>", buf, &buf[sizeof buf - 1], e);
+ expand("<\201g>", buf, &buf[sizeof buf], e);
- expand(fancy, buf, &buf[sizeof buf - 1], e);
+ expand(fancy, buf, &buf[sizeof buf], e);
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 8.66 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.67 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 8.66 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.67 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
{
FILE *cf;
register char *p;
{
FILE *cf;
register char *p;
+ char lbuf[MAXNAME + 1];
extern bool strcontainedin();
/* is this an interesting entry? */
extern bool strcontainedin();
/* is this an interesting entry? */
syslog(LOG_CRIT, "orderq: bogus qf name %s",
d->d_name);
#endif
syslog(LOG_CRIT, "orderq: bogus qf name %s",
d->d_name);
#endif
- if (strlen(d->d_name) >= MAXNAME)
- d->d_name[MAXNAME - 1] = '\0';
+ if (strlen(d->d_name) > MAXNAME)
+ d->d_name[MAXNAME] = '\0';
strcpy(lbuf, d->d_name);
lbuf[0] = 'Q';
(void) rename(d->d_name, lbuf);
strcpy(lbuf, d->d_name);
lbuf[0] = 'Q';
(void) rename(d->d_name, lbuf);
int flags = 0;
int qfver;
char message[MAXLINE];
int flags = 0;
int qfver;
char message[MAXLINE];
- char bodytype[MAXNAME];
+ char bodytype[MAXNAME + 1];
printf("%8s", w->w_name + 2);
f = fopen(w->w_name, "r");
printf("%8s", w->w_name + 2);
f = fopen(w->w_name, "r");
static char c2;
time_t now;
struct tm *tm;
static char c2;
time_t now;
struct tm *tm;
- static char buf[MAXNAME];
+ static char buf[MAXNAME + 1];
-static char sccsid[] = "@(#)recipient.c 8.71 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c 8.72 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
int findusercount = 0;
int i;
char *buf;
int findusercount = 0;
int i;
char *buf;
- char buf0[MAXNAME]; /* unquoted image of the user name */
+ char buf0[MAXNAME + 1]; /* unquoted image of the user name */
extern int safefile();
e->e_to = a->q_paddr;
extern int safefile();
e->e_to = a->q_paddr;
/* get unquoted user for file, program or user.name check */
i = strlen(a->q_user);
/* get unquoted user for file, program or user.name check */
i = strlen(a->q_user);
buf = xalloc(i + 1);
else
buf = buf0;
buf = xalloc(i + 1);
else
buf = buf0;
+ char nbuf[MAXNAME + 1];
-static char sccsid[] = "@(#)savemail.c 8.54 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 8.55 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
bool sendbody;
register ENVELOPE *e;
{
bool sendbody;
register ENVELOPE *e;
{
extern putheader(), errbody();
register ENVELOPE *ee;
ENVELOPE *oldcur = CurEnv;
extern putheader(), errbody();
register ENVELOPE *ee;
ENVELOPE *oldcur = CurEnv;
-static char sccsid[] = "@(#)usersmtp.c 8.36 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.37 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)usersmtp.c 8.36 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.37 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
int r;
char *bufp;
char *bodytype;
int r;
char *bufp;
char *bodytype;
char optbuf[MAXLINE];
if (tTd(18, 2))
char optbuf[MAXLINE];
if (tTd(18, 2))
!bitnset(M_NO_NULL_FROM, m->m_flags))
(void) strcpy(buf, "");
else
!bitnset(M_NO_NULL_FROM, m->m_flags))
(void) strcpy(buf, "");
else
- expand("\201g", buf, &buf[sizeof buf - 1], e);
+ expand("\201g", buf, &buf[sizeof buf], e);
if (buf[0] == '<')
{
/* strip off <angle brackets> (put back on below) */
if (buf[0] == '<')
{
/* strip off <angle brackets> (put back on below) */