The length returned by ptrace_read_string() include the NUL.

We were wasting a extra byte in the string table for each entry.
This commit is contained in:
Todd C. Miller
2022-07-27 14:11:13 -06:00
parent 882990b1b3
commit 25513b4f37

View File

@@ -428,8 +428,8 @@ ptrace_read_vec(pid_t pid, struct sudo_ptrace_regs *regs, unsigned long addr,
if (slen == (size_t)-1)
debug_return_size_t(-1);
vec[len++] = buf;
buf += slen + 1;
bufsize -= slen + 1;
buf += slen;
bufsize -= slen;
addr += regs->wordsize;
continue;
}