]> granicus.if.org Git - strace/commitdiff
strace -P: fix handling of invalid syscalls
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 6 Feb 2012 17:13:59 +0000 (17:13 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 6 Feb 2012 17:13:59 +0000 (17:13 +0000)
* pathtrace.c (pathtrace_match): Check the given syscall number using
SCNO_IN_RANGE.

pathtrace.c

index d7ba87cc69d97e2d736a81501ec3e61a8fbbd99e..5fa8be4c7b5d9326bf768020502415910c849492 100644 (file)
@@ -179,6 +179,9 @@ pathtrace_match(struct tcb *tcp)
        if (selected[0] == NULL)
                return 1;
 
+       if (!SCNO_IN_RANGE(tcp->scno))
+               return 0;
+
        s = &sysent[tcp->scno];
 
        if (!(s->sys_flags & (TRACE_FILE | TRACE_DESC)))