Fail with wrong thread execute payload

Otherwise it produces a segfault.
This commit is contained in:
Rodrigo Arias 2023-02-20 18:39:52 +01:00 committed by Rodrigo Arias Mallo
parent 7f82aa08f8
commit a49555fe46

View File

@ -18,6 +18,11 @@ pre_thread_execute(struct emu *emu, struct thread *th)
return -1; return -1;
} }
if (emu->ev->payload_size < 4) {
err("missing payload in thread %d execute event", th->tid);
return -1;
}
int cpuid = emu->ev->payload->i32[0]; int cpuid = emu->ev->payload->i32[0];
struct cpu *cpu = loom_find_cpu(emu->loom, cpuid); struct cpu *cpu = loom_find_cpu(emu->loom, cpuid);