about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-02-23 13:08:47 -0500
committerRich Felker <dalias@aerifal.cx>2012-02-23 13:08:47 -0500
commit00b883a95561b7ed31b0907fcd7cb16267de6e4d (patch)
tree4d090345db9aeea56cbaf9db7b3ec0bbd4584a50 /src
parent56ddcc720837522e0ff0199422284a7e69e5e891 (diff)
downloadmusl-00b883a95561b7ed31b0907fcd7cb16267de6e4d.tar.gz
musl-00b883a95561b7ed31b0907fcd7cb16267de6e4d.tar.xz
musl-00b883a95561b7ed31b0907fcd7cb16267de6e4d.zip
fix (hopefully) PTRACE_TRACEME (command 0) argument handling
Diffstat (limited to 'src')
-rw-r--r--src/misc/ptrace.c4
1 files 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;
 }