From f529663dad8f3ff003f2e283c13c70ffb9c19b75 Mon Sep 17 00:00:00 2001 From: Folkert van Heusden Date: Mon, 14 Oct 2024 09:55:53 +0200 Subject: [PATCH] theoretical problem found by snyke --- log.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/log.cpp b/log.cpp index 96a771b..8043882 100644 --- a/log.cpp +++ b/log.cpp @@ -103,6 +103,8 @@ namespace logging { sl_nr += 2; // critical int offset = snprintf(err_log_buf, sizeof err_log_buf, "<%d>%s|%s] ", sl_nr, component, context.c_str()); + if (offset == -1) + offset = 0; // snprintf failed, proceeed without component etc va_list ap; va_start(ap, fmt);