diff --git a/src/sf_util.c b/src/sf_util.c index 73c0072..b726f1c 100644 --- a/src/sf_util.c +++ b/src/sf_util.c @@ -52,6 +52,9 @@ void log_plus(const int priority, const char* file, va_start(ap, fmt); hlen += vsnprintf(buf+hlen, sizeof(buf)-hlen, fmt, ap); va_end(ap); + if (hlen >= sizeof(buf)) { + hlen = sizeof(buf) - 1; + } log_it_ex1(&g_log_context, priority, buf, hlen); }