diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-02-23 13:08:47 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-02-23 13:08:47 -0500 |
commit | 00b883a95561b7ed31b0907fcd7cb16267de6e4d (patch) | |
tree | 4d090345db9aeea56cbaf9db7b3ec0bbd4584a50 /src/misc/ptrace.c | |
parent | 56ddcc720837522e0ff0199422284a7e69e5e891 (diff) | |
download | musl-00b883a95561b7ed31b0907fcd7cb16267de6e4d.tar.gz |
fix (hopefully) PTRACE_TRACEME (command 0) argument handling
Diffstat (limited to 'src/misc/ptrace.c')
-rw-r--r-- | src/misc/ptrace.c | 4 |
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; } |