From 67102c47253a136af6bd918cb20606f0c9cd6596 Mon Sep 17 00:00:00 2001 From: iefa m Date: Fri, 2 Oct 2026 10:43:28 +0530 Subject: [PATCH] proc_read_vec: bound trailing NUL trim to the current string table --- src/exec_ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exec_ptrace.c b/src/exec_ptrace.c index ed4e450528..44a0692777 100644 --- a/src/exec_ptrace.c +++ b/src/exec_ptrace.c @@ -1600,7 +1600,7 @@ proc_read_vec(pid_t pid, const char *name, int *countp, char ***vecp, close(fd); /* Trim off the extra NUL byte at the end of the string table. */ - if (strtab - *bufp >= 2 && strtab[-1] == '\0' && strtab[-2] == '\0') { + if (strtab - (*bufp + off) >= 2 && strtab[-1] == '\0' && strtab[-2] == '\0') { strtab--; remainder++; }