From 62c8a21c10c41629d63e93bee904514f456def74 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Thu, 9 Feb 2017 12:19:27 +0100 Subject: [PATCH] BUG/MINOR: sendmail: The return of vsnprintf is not cleanly tested The string formatted by vsnprintf may be bigger than the size of the buffer "buf". This case is not tested. This sould be backported to 1.6 and 1.7 --- src/checks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checks.c b/src/checks.c index 7d4242267..49bd886bf 100644 --- a/src/checks.c +++ b/src/checks.c @@ -3398,7 +3398,7 @@ void send_email_alert(struct server *s, int level, const char *format, ...) len = vsnprintf(buf, sizeof(buf), format, argp); va_end(argp); - if (len < 0) { + if (len < 0 || len >= sizeof(buf)) { Alert("Email alert [%s] could not format message\n", p->id); return; }