From 0884d14bde8ee142a5688cec690e1a5320a00af8 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 16 Aug 2026 01:55:27 -0400 Subject: [PATCH] [common] linux/proctitle: zero out entire usable memory block This avoids additional arguments showing up when their memory hasn't been touched at all. --- common/src/platform/linux/proctitle.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/platform/linux/proctitle.c b/common/src/platform/linux/proctitle.c index b5ad2c69..9aa27869 100644 --- a/common/src/platform/linux/proctitle.c +++ b/common/src/platform/linux/proctitle.c @@ -123,10 +123,10 @@ void lgSetProcessTitle(const char * title) if (!totalSize) return; - size_t effective = strlen(title) + 1; + size_t effective = strlen(title); if (effective > totalSize) - effective = totalSize; + effective = totalSize - 1; - memcpy(buffer, title, effective - 1); - buffer[effective - 1] = '\0'; + memcpy(buffer, title, effective); + memset(buffer + effective, 0, totalSize - effective); }