From 00b883a95561b7ed31b0907fcd7cb16267de6e4d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 23 Feb 2012 13:08:47 -0500 Subject: [PATCH] fix (hopefully) PTRACE_TRACEME (command 0) argument handling --- src/misc/ptrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/ptrace.c b/src/misc/ptrace.c index f8540698..83b8022b 100644 --- a/src/misc/ptrace.c +++ b/src/misc/ptrace.c @@ -17,9 +17,9 @@ long ptrace(int req, ...) addr2 = va_arg(ap, void *); va_end(ap); - if (req<4U) data = &result; + if (req-1U < 3) data = &result; ret = syscall(SYS_ptrace, req, pid, addr, data, addr2); - if (ret<0 || req>=4U) return ret; + if (ret < 0 || req-1U >= 3) return ret; return result; } -- 2.25.1