From: Jérémie Astor Date: Mon, 2 Aug 2021 19:48:13 +0000 (+0200) Subject: :bug: overflow Shred arg size X-Git-Tag: nightly~501 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9be1616cb16a7593f04da56bdfe672e0ba3fb027;p=gwion.git :bug: overflow Shred arg size --- 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