diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-24 12:03:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-24 12:03:59 -0300 |
commit | c1dc08e8e8e22af9902a6341b4a9a9a7811954cc (patch) | |
tree | 7ce5d6c721bd306f83555d821d6372651e3ab223 /lapi.c | |
parent | 0f7025dcae08e35a31866234d8d757ab54392190 (diff) | |
download | lua-c1dc08e8e8e22af9902a6341b4a9a9a7811954cc.tar.gz lua-c1dc08e8e8e22af9902a6341b4a9a9a7811954cc.tar.bz2 lua-c1dc08e8e8e22af9902a6341b4a9a9a7811954cc.zip |
Length of external strings must fit in Lua integer
(As the length of any string in Lua.)
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -551,6 +551,7 @@ LUA_API const char *lua_pushextlstring (lua_State *L, | |||
551 | const char *s, size_t len, lua_Alloc falloc, void *ud) { | 551 | const char *s, size_t len, lua_Alloc falloc, void *ud) { |
552 | TString *ts; | 552 | TString *ts; |
553 | lua_lock(L); | 553 | lua_lock(L); |
554 | api_check(L, len <= MAX_SIZE, "string too large"); | ||
554 | api_check(L, s[len] == '\0', "string not ending with zero"); | 555 | api_check(L, s[len] == '\0', "string not ending with zero"); |
555 | ts = luaS_newextlstr (L, s, len, falloc, ud); | 556 | ts = luaS_newextlstr (L, s, len, falloc, ud); |
556 | setsvalue2s(L, L->top.p, ts); | 557 | setsvalue2s(L, L->top.p, ts); |