From: thib Date: Sat, 21 Apr 2001 08:42:33 +0000 (+0000) Subject: bug corrected : a too long message used not to be truncated correctly, and the string... X-Git-Tag: ver1564~309 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d0e6561ebd2072aadea7cd993034837cebe4acd;p=fcron bug corrected : a too long message used not to be truncated correctly, and the string " (truncated)" was copyed somewhere in the memory, which could lead to a crash --- diff --git a/log.c b/log.c index 88679e9..00195ee 100644 --- a/log.c +++ b/log.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: log.c,v 1.5 2001-02-14 13:52:09 thib Exp $ */ + /* $Id: log.c,v 1.6 2001-04-21 08:42:33 thib Exp $ */ /* This code is inspired by Anacron's sources of Itai Tzur ( thanks to him ) */ @@ -67,7 +67,7 @@ make_msg(char *fmt, va_list args) * returns when the buffer overflows. Hmmm... */ len = vsnprintf(msg, MAX_MSG + 1, fmt, args); if (len >= MAX_MSG) - strcpy(msg + sizeof(msg) - sizeof(truncated), truncated); + strcpy(msg + (MAX_MSG + 1) - sizeof(truncated), truncated); return msg; }