Length of external strings must fit in Lua integer
(As the length of any string in Lua.)
This commit is contained in:
1
lapi.c
1
lapi.c
@@ -551,6 +551,7 @@ LUA_API const char *lua_pushextlstring (lua_State *L,
|
||||
const char *s, size_t len, lua_Alloc falloc, void *ud) {
|
||||
TString *ts;
|
||||
lua_lock(L);
|
||||
api_check(L, len <= MAX_SIZE, "string too large");
|
||||
api_check(L, s[len] == '\0', "string not ending with zero");
|
||||
ts = luaS_newextlstr (L, s, len, falloc, ud);
|
||||
setsvalue2s(L, L->top.p, ts);
|
||||
|
||||
Reference in New Issue
Block a user