FFI: Limit number of arguments for recorded calls.

This commit is contained in:
Mike Pall 2011-02-05 23:01:10 +01:00
parent 26fadcd25b
commit 26bb0fe24b

View File

@ -681,7 +681,7 @@ static TRef crec_call_args(jit_State *J, RecordFFData *rd,
for (n = 0; J->base[n+1]; n++) { for (n = 0; J->base[n+1]; n++) {
CType *d; CType *d;
do { do {
if (!ct->sib) if (!ct->sib || n >= CCI_NARGS_MAX)
lj_trace_err(J, LJ_TRERR_NYICALL); lj_trace_err(J, LJ_TRERR_NYICALL);
ct = ctype_get(cts, ct->sib); ct = ctype_get(cts, ct->sib);
} while (ctype_isattrib(ct->info)); } while (ctype_isattrib(ct->info));