FFI: Ensure library is loaded before de-serializing FFI types.

Reported by ImagicTheCat.
This commit is contained in:
Mike Pall
2022-01-15 18:32:34 +01:00
parent d5a237eae0
commit c21c6cb417
2 changed files with 5 additions and 0 deletions

View File

@@ -417,6 +417,7 @@ static char *serialize_get(char *r, SBufExt *sbx, TValue *o)
uint32_t sz = tp == SER_TAG_COMPLEX ? 16 : 8;
GCcdata *cd;
if (LJ_UNLIKELY(r + sz > w)) goto eob;
if (LJ_UNLIKELY(!ctype_ctsG(G(sbufL(sbx))))) goto badtag;
cd = lj_cdata_new_(sbufL(sbx),
tp == SER_TAG_INT64 ? CTID_INT64 :
tp == SER_TAG_UINT64 ? CTID_UINT64 : CTID_COMPLEX_DOUBLE,