summaryrefslogtreecommitdiffstats
path: root/sys/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/syscall.c')
-rw-r--r--sys/syscall.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/syscall.c b/sys/syscall.c
index 0da3475..31f9078 100644
--- a/sys/syscall.c
+++ b/sys/syscall.c
@@ -50,6 +50,10 @@ int
_syscall_handle_switch(syscall_context_t *ctx)
{
uint8_t target_type = obj_gettype(ctx->target.obj);
+ if(target_type == JOVE_OBJ_NONE) {
+ klogf("Tried to call syscall on NULL object %P\n", ctx->header->path, ctx->header->pathlen);
+ return -EBADOBJ;
+ }
if(target_type > 0x7F) {
return _syscall_handle_arch(ctx);
}