+++ /dev/null
-$DragonFly: src/usr.sbin/sendmail/mci.c.patch,v 1.4 2007/04/14 17:43:48 gshapiro Exp $
-
-Index: mci.c
-===================================================================
-RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/sendmail-8.13.6/sendmail/mci.c,v
-retrieving revision 1.1.1.1
-diff -u -r1.1.1.1 mci.c
---- mci.c 6 Jun 2005 04:25:22 -0000 1.1.1.1
-+++ mci.c 23 Aug 2005 15:04:54 -0000
-@@ -1131,7 +1131,7 @@
- size_t len;
- char *newptr;
- struct dirent *e;
-- char newpath[MAXPATHLEN];
-+ char newpath[PATH_MAX];
- #if MAXPATHLEN <= MAXNAMLEN - 3
- ERROR "MAXPATHLEN <= MAXNAMLEN - 3"
- #endif /* MAXPATHLEN <= MAXNAMLEN - 3 */
-@@ -1143,7 +1143,7 @@
- pathname, sm_errstring(errno));
- return -1;
- }
-- len = sizeof(newpath) - MAXNAMLEN - 3;
-+ len = sizeof(newpath) - 2; /* enough space for '/' and NUL */
- if (sm_strlcpy(newpath, pathname, len) >= len)
- {
- if (tTd(56, 2))
-@@ -1153,6 +1153,7 @@
- }
- newptr = newpath + strlen(newpath);
- *newptr++ = '/';
-+ len = sizeof(newpath) - (newptr - newpath);
-
- /*
- ** repeat until no file has been removed
-@@ -1169,9 +1170,8 @@
- if (e->d_name[0] == '.')
- continue;
-
-- (void) sm_strlcpy(newptr, e->d_name,
-- sizeof(newpath) -
-- (newptr - newpath));
-+ if (sm_strlcpy(newptr, e->d_name, len) >= len)
-+ continue;
-
- if (StopRequest)
- stop_sendmail();
/* abort milter filters */ \
MILTER_ABORT(e); \
\
-@@ -487,8 +489,9 @@ /* clean up a bit */ \
+@@ -490,8 +489,9 @@ /* clean up a bit */ \
smtp.sm_gotmail = false; \
SuprErrs = true; \
- dropenvelope(e, true, false); \
+ (void) dropenvelope(e, true, false); \
- sm_rpool_free(e->e_rpool); \
+ orpool = e->e_rpool; \
e = newenvelope(e, CurEnv, sm_rpool_new_x(NULL)); \
CurEnv = e; \
e->e_features = features; \
\
-@@ -3285,6 +3288,7 @@ char *id;
+@@ -3345,6 +3288,7 @@ char *id;
char *oldid;
unsigned int features;
char buf[32];
SmtpPhase = "server DATA";
if (!smtp->sm_gotmail)
-@@ -3775,18 +3779,12 @@ if (WILL_BE_QUEUED(ee->e_sendmode))
- dropenvelope(ee, true, false);
- }
- }
-- sm_rpool_free(e->e_rpool);
--
-- /*
-- ** At this point, e == &MainEnvelope, but if we did splitting,
-- ** then CurEnv may point to an envelope structure that was just
-- ** freed with the rpool. So reset CurEnv *before* calling
-- ** newenvelope.
-- */
+@@ -3863,8 +3863,9 @@
CurEnv = e;
features = e->e_features;
+- sm_rpool_free(e->e_rpool);
+ orpool = e->e_rpool;
newenvelope(e, e, sm_rpool_new_x(NULL));
+ sm_rpool_free(orpool);