From 9be1616cb16a7593f04da56bdfe672e0ba3fb027 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 2 Aug 2021 21:48:13 +0200 Subject: [PATCH] :bug: overflow Shred arg size --- src/lib/shred.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/shred.c b/src/lib/shred.c index b570e8ef..7c2533e7 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -104,7 +104,7 @@ static MFUN(shred_args) { static MFUN(shred_arg) { const VM_Shred s = ME(o); const m_int idx = *(m_int *)MEM(SZ_INT); - if (s->info->args.ptr && idx >= 0) { + if (s->info->args.ptr && idx >= 0 && (m_uint)idx < vector_size(&s->info->args)) { const m_str str = (m_str)vector_at(&s->info->args, *(m_uint *)MEM(SZ_INT)); *(M_Object *)RETURN = str ? new_string(shred->info->mp, shred, str) : NULL; } else -- 2.43.0