]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Properly fix loading of embedded bytecode.
authorMike Pall <mike>
Fri, 20 Sep 2013 09:36:33 +0000 (11:36 +0200)
committerMike Pall <mike>
Fri, 20 Sep 2013 09:36:33 +0000 (11:36 +0200)
src/lj_bcread.c

index 9f02550089b1ee572ff0285732d5734d968205f0..940db9dd121955d4eba8e8f3aec207a16a65ba0a 100644 (file)
@@ -446,7 +446,8 @@ GCproto *lj_bcread(LexState *ls)
     setprotoV(L, L->top, pt);
     incr_top(L);
   }
-  if (ls->p < ls->pe || L->top-1 != bcread_oldtop(L, ls))
+  if ((int32_t)(2*(uint32_t)(ls->pe - ls->p)) > 0 ||
+      L->top-1 != bcread_oldtop(L, ls))
     bcread_error(ls, LJ_ERR_BCBAD);
   /* Pop off last prototype. */
   L->top--;