From 2cd7afe0c5f34cb2af944a3588200560e702c789 Mon Sep 17 00:00:00 2001 From: ProgramSnail Date: Fri, 22 Nov 2024 17:10:40 +0300 Subject: [PATCH] +1 byterun check --- byterun/src/interpreter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/byterun/src/interpreter.c b/byterun/src/interpreter.c index f117197eb..29f4ca737 100644 --- a/byterun/src/interpreter.c +++ b/byterun/src/interpreter.c @@ -302,6 +302,9 @@ void run(bytefile *bf, int argc, char **argv) { var_by_category(to_var_category(l), ip_read_int(&s.ip)); s_push(*var_ptr); } + if (call_offset >= bf->code_size) { + s_failure(&s, "jump out of file"); + } s_push(bf->code_ptr + call_offset); void *closure = Bclosure((aint *)__gc_stack_top, args_count);