]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Disallow nested VLS.
authorMike Pall <mike>
Wed, 19 Feb 2014 21:05:34 +0000 (22:05 +0100)
committerMike Pall <mike>
Wed, 19 Feb 2014 21:05:34 +0000 (22:05 +0100)
src/lj_cparse.c

index 767ac179861c34ece03cc4f8034ea9100ac92004..6ffe16a2f184b6c713ac883aaac5f88f04cf2086 100644 (file)
@@ -1258,7 +1258,7 @@ static void cp_struct_layout(CPState *cp, CTypeID sid, CTInfo sattr)
       sinfo |= (info & (CTF_QUAL|CTF_VLA));  /* Merge pseudo-qualifiers. */
 
       /* Check for size overflow and determine alignment. */
-      if (sz >= 0x20000000u || bofs + csz < bofs) {
+      if (sz >= 0x20000000u || bofs + csz < bofs || (info & CTF_VLA)) {
        if (!(sz == CTSIZE_INVALID && ctype_isarray(info) &&
              !(sinfo & CTF_UNION)))
          cp_err(cp, LJ_ERR_FFI_INVSIZE);