From c1dc08e8e8e22af9902a6341b4a9a9a7811954cc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 24 Jun 2024 12:03:59 -0300 Subject: Length of external strings must fit in Lua integer (As the length of any string in Lua.) --- lapi.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index 2b14c15e..f00bd53f 100644 --- a/lapi.c +++ b/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); -- cgit v1.2.3-55-g6feb