The bound used `sizeof(syscall_names)` (byte size of the pointer array)
instead of the entry count, allowing the SIGSYS handler to read up to
`sizeof(char*)-1` entries past the end of the table when an unexpected
syscall number was trapped.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
/* Log them. Technically, `log_warnx()` is not signal safe, but we are
* unlikely to reenter here. */
log_warnx("seccomp", "invalid syscall attempted: %s(%d)",
- (syscall < sizeof(syscall_names)) ? syscall_names[syscall] : "unknown",
+ (syscall < sizeof(syscall_names) / sizeof(syscall_names[0])) ?
+ syscall_names[syscall] :
+ "unknown",
syscall);
/* Kill children and exit */