From 234c56b87f42d4bb30e959285b15bb39edb8b11c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 28 Aug 2022 08:27:30 -0600 Subject: [PATCH] Protect ptrace_readv_string() with #ifdef HAVE_PROCESS_VM_READV --- src/exec_ptrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/exec_ptrace.c b/src/exec_ptrace.c index e765de01b..d7f939652 100644 --- a/src/exec_ptrace.c +++ b/src/exec_ptrace.c @@ -343,6 +343,7 @@ ptrace_setregs(int pid, struct sudo_ptrace_regs *regs) debug_return_bool(true); } +#ifdef HAVE_PROCESS_VM_READV /* * Read the string at addr and store in buf using process_vm_readv(2). * Returns the number of bytes stored, including the NUL. @@ -395,6 +396,7 @@ ptrace_readv_string(pid_t pid, unsigned long addr, char *buf, size_t bufsize) } debug_return_ssize_t(-1); } +#endif /* HAVE_PROCESS_VM_READV */ /* * Read the string at addr and store in buf using ptrace(2).