diff options
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/syscall.c | 4 | ||||
| -rw-r--r-- | sys/syscall_objdir.c | 1 |
2 files changed, 5 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); } diff --git a/sys/syscall_objdir.c b/sys/syscall_objdir.c index 5a6786d..b4d3800 100644 --- a/sys/syscall_objdir.c +++ b/sys/syscall_objdir.c @@ -15,6 +15,7 @@ s_syscall_objdir_objtype( CHECK_TOOSMALL(bytes_needed, payload_size, "Message is too small for payload."); uint16_t local_idx = *((uint16_t*)payload_data); + if(local_idx > JOVE_OBJDIR_ENTRIES) { kprintf("%s: Object index is out of bounds (>= 512)\n", __func__); return EOOB; |
