strace -P: fix handling of invalid syscalls

* pathtrace.c (pathtrace_match): Check the given syscall number using
SCNO_IN_RANGE.
This commit is contained in:
Дмитрий Левин 2012-02-06 17:13:59 +00:00
parent e752bed4af
commit bdec9cbceb

View File

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