diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2003-09-19 23:14:57 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2003-09-19 23:14:57 +0000 |
commit | ff300598d7a6eb62ff5943e34793264a25bbaccf (patch) | |
tree | 10254441c41119a570c883ad07917b96add798c0 /contrib/sendmail/src/mci.c | |
parent | aef2ea8df10edaa6310033ae78c9fba183ddd1c1 (diff) | |
download | FreeBSD-src-ff300598d7a6eb62ff5943e34793264a25bbaccf.zip FreeBSD-src-ff300598d7a6eb62ff5943e34793264a25bbaccf.tar.gz |
Fix sendmail 8.12.10 import conflicts
Diffstat (limited to 'contrib/sendmail/src/mci.c')
-rw-r--r-- | contrib/sendmail/src/mci.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c index 033387b..a6b558e 100644 --- a/contrib/sendmail/src/mci.c +++ b/contrib/sendmail/src/mci.c @@ -9,11 +9,12 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * + * $FreeBSD$ */ #include <sendmail.h> -SM_RCSID("@(#)$Id: mci.c,v 8.205.2.3 2003/01/07 03:56:19 ca Exp $") +SM_RCSID("@(#)$Id: mci.c,v 8.205.2.4 2003/03/31 17:35:27 ca Exp $") #if NETINET || NETINET6 # include <arpa/inet.h> @@ -548,11 +549,21 @@ mci_dump(mci, logit) } (void) sm_snprintf(p, SPACELEFT(buf, p), "flags=%lx", mci->mci_flags); p += strlen(p); + + /* + ** The following check is just for paranoia. It protects the + ** assignment in the if() clause. If there's not some minimum + ** amount of space we can stop right now. The check will not + ** trigger as long as sizeof(buf)=4000. + */ + + if (p >= buf + sizeof(buf) - 4) + goto printit; if (mci->mci_flags != 0) { struct mcifbits *f; - *p++ = '<'; + *p++ = '<'; /* protected above */ for (f = MciFlags; f->mcif_bit != 0; f++) { if (!bitset(f->mcif_bit, mci->mci_flags)) @@ -1152,7 +1163,7 @@ mci_traverse_persistent(action, pathname) if (hostptr != host) *(hostptr++) = '.'; start = end; - while (*(start - 1) != '/') + while (start > pathname && *(start - 1) != '/') start--; if (*end == '.') @@ -1162,7 +1173,7 @@ mci_traverse_persistent(action, pathname) *(hostptr++) = *scan; end = start - 2; - } while (*end == '.'); + } while (end > pathname && *end == '.'); *hostptr = '\0'; @@ -1352,7 +1363,7 @@ mci_purge_persistent(pathname, hostname) /* ** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname ** -** Given `host', convert from a.b.c to $QueueDir/.hoststat/c./b./a, +** Given `host', convert from a.b.c to $HostStatDir/c./b./a, ** putting the result into `path'. if `createflag' is set, intervening ** directories will be created as needed. ** |