strace: Gracefully handle invalid syscall numbers.
OpenJDK 1.8 somehow manages to trigger this. Before this commit it would just attempt to read past the end of the vector, which of course segfaulted, which seems to imply nobody has run into this case before.
This commit is contained in:
parent
ffd9d565d2
commit
49783dc8f2
@ -686,7 +686,12 @@ main(int argc, const char *const *argv)
|
||||
Team* team = it->second;
|
||||
MemoryReader& memoryReader = team->GetMemoryReader();
|
||||
|
||||
int32 syscallNumber = message.post_syscall.syscall;
|
||||
uint32 syscallNumber = message.post_syscall.syscall;
|
||||
if (syscallNumber >= sSyscallVector.size()) {
|
||||
fprintf(stderr, "%s: invalid syscall %" B_PRIu32 " attempted\n",
|
||||
kCommandName, syscallNumber);
|
||||
break;
|
||||
}
|
||||
Syscall* syscall = sSyscallVector[syscallNumber];
|
||||
|
||||
if (stats)
|
||||
|
Loading…
x
Reference in New Issue
Block a user