Skip to content

Commit 9f141a8

Browse files
committed
Add an exception for unresolved syscall numbers
This eases debugging when libseccomp doesn't know the name of a syscall.
1 parent 60abeb0 commit 9f141a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/seccomp/SeccompListener.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ std::string SeccompListener::resolveSyscallNumber(
193193
char* name = seccomp_syscall_resolve_num_arch(
194194
SeccompContext::SECCOMP_FILTER_ARCHITECTURES.at(arch),
195195
syscallNumber);
196+
if (name == NULL)
197+
throw Exception(
198+
"Can't resolve the name of syscall number " +
199+
std::to_string(syscallNumber));
196200
std::string syscallName(name);
197201
free(name);
198202
return syscallName;

0 commit comments

Comments
 (0)