1 $DragonFly: src/usr.sbin/sendmail/mci.c.patch,v 1.4 2007/04/14 17:43:48 gshapiro Exp $
4 ===================================================================
5 RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/sendmail-8.13.6/sendmail/mci.c,v
6 retrieving revision 1.1.1.1
7 diff -u -r1.1.1.1 mci.c
8 --- mci.c 6 Jun 2005 04:25:22 -0000 1.1.1.1
9 +++ mci.c 23 Aug 2005 15:04:54 -0000
14 - char newpath[MAXPATHLEN];
15 + char newpath[PATH_MAX];
16 #if MAXPATHLEN <= MAXNAMLEN - 3
17 ERROR "MAXPATHLEN <= MAXNAMLEN - 3"
18 #endif /* MAXPATHLEN <= MAXNAMLEN - 3 */
20 pathname, sm_errstring(errno));
23 - len = sizeof(newpath) - MAXNAMLEN - 3;
24 + len = sizeof(newpath) - 2; /* enough space for '/' and NUL */
25 if (sm_strlcpy(newpath, pathname, len) >= len)
30 newptr = newpath + strlen(newpath);
32 + len = sizeof(newpath) - (newptr - newpath);
35 ** repeat until no file has been removed
37 if (e->d_name[0] == '.')
40 - (void) sm_strlcpy(newptr, e->d_name,
42 - (newptr - newpath));
43 + if (sm_strlcpy(newptr, e->d_name, len) >= len)