|
@@ -661,7 +661,7 @@ void luaV_concat (lua_State *L, int total) {
|
|
/* collect total length and number of strings */
|
|
/* collect total length and number of strings */
|
|
for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) {
|
|
for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) {
|
|
size_t l = tsslen(tsvalue(s2v(top - n - 1)));
|
|
size_t l = tsslen(tsvalue(s2v(top - n - 1)));
|
|
- if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl)) {
|
|
|
|
|
|
+ if (l_unlikely(l >= MAX_SIZE - sizeof(TString) - tl)) {
|
|
L->top.p = top - total; /* pop strings to avoid wasting stack */
|
|
L->top.p = top - total; /* pop strings to avoid wasting stack */
|
|
luaG_runerror(L, "string length overflow");
|
|
luaG_runerror(L, "string length overflow");
|
|
}
|
|
}
|