diff options
-rw-r--r-- | gnu/usr.sbin/sendmail/libmilter/smfi.c | 8 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/libsm/strl.c | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/gnu/usr.sbin/sendmail/libmilter/smfi.c b/gnu/usr.sbin/sendmail/libmilter/smfi.c index 4a4132f083e..da5c5c58ef4 100644 --- a/gnu/usr.sbin/sendmail/libmilter/smfi.c +++ b/gnu/usr.sbin/sendmail/libmilter/smfi.c @@ -430,18 +430,20 @@ smfi_setmlreply(ctx, rcode, xcode, va_alist) tl = strlen(txt); if (tl > MAXREPLYLEN) - return MI_FAILURE; + break; /* this text, reply codes, \r\n */ len += tl + 2 + rlen; if (++args > MAXREPLIES) - return MI_FAILURE; + break; /* XXX check also for unprintable chars? */ if (strpbrk(txt, "\r\n") != NULL) - return MI_FAILURE; + break; } SM_VA_END(ap); + if (txt != NULL) + return MI_FAILURE; /* trailing '\0' */ ++len; diff --git a/gnu/usr.sbin/sendmail/libsm/strl.c b/gnu/usr.sbin/sendmail/libsm/strl.c index 21c31464131..86947ddb034 100644 --- a/gnu/usr.sbin/sendmail/libsm/strl.c +++ b/gnu/usr.sbin/sendmail/libsm/strl.c @@ -229,6 +229,7 @@ sm_strlcpyn(dst, len, n, va_alist) i = 0; while (n-- > 0) i += strlen(SM_VA_ARG(ap, char *)); + SM_VA_END(ap); return i; } @@ -251,9 +252,11 @@ sm_strlcpyn(dst, len, n, va_alist) j += strlen(str + i); while (n-- > 0) j += strlen(SM_VA_ARG(ap, char *)); + SM_VA_END(ap); return j; } } + SM_VA_END(ap); dst[j] = '\0'; /* terminate dst; there is space since j < len */ return j; |