From 4cee75dab5ea43cbacd70d8624ac56c98112ee65 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 16 Aug 2026 02:16:36 -0400 Subject: [PATCH] [common] linux/proctitle: fix off-by-one bug 0884d14bde8ee142a5688cec690e1a5320a00af8 introduces an off-by-one bug: if `strlen(title) == totalSize`, then no space will be left for a null terminator. --- common/src/platform/linux/proctitle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/platform/linux/proctitle.c b/common/src/platform/linux/proctitle.c index 9aa27869..3d45db38 100644 --- a/common/src/platform/linux/proctitle.c +++ b/common/src/platform/linux/proctitle.c @@ -124,7 +124,7 @@ void lgSetProcessTitle(const char * title) return; size_t effective = strlen(title); - if (effective > totalSize) + if (effective >= totalSize) effective = totalSize - 1; memcpy(buffer, title, effective);