The Lua development repository, as seen by the Lua team. Mirrored irregularly. Please DO NOT send pull requests. Report issues in the Lua mailing list https://www.lua.org/lua-l.html https://lua.org
Find a file
Roberto Ierusalimschy e3716ee161 Fix in string.rep
The cast of n (number of repetitions) to size_t may truncate its value,
causing a buffer overflow later. Better to check the buffer size
using lua_Integer, as all string lengths must fit in a lua_Integer and
n already is a lua_Integer. If everything fits in MAX_SIZE, then we can
safely convert n to size_t and compute the buffer size as a size_t.

As a corner case, n can be larger than size_t if the strings being
repeated have length zero, but in this case it will be multiplied by
zero, so an overflow in the cast is irrelevant.
2025-07-23 18:12:53 -03:00
manual Short strings can be external, too 2025-07-15 14:40:27 -03:00
testes Randomness added to table length computation 2025-07-18 16:18:30 -03:00
.gitignore 'lua_upvalueid' returns NULL on invalid upvalue index 2020-10-12 14:51:28 -03:00
all 'lua_checkstack' doesn't need to check stack overflow 2022-05-23 10:38:03 -03:00
lapi.c Randomness added to table length computation 2025-07-18 16:18:30 -03:00
lapi.h Using CIST_CLSRET instead of trick with 'nresults' 2024-07-19 17:34:22 -03:00
lauxlib.c Order change in 'pushfuncname' 2025-04-03 15:31:22 -03:00
lauxlib.h Detail 2025-02-28 15:48:45 -03:00
lbaselib.c Parameter for lua_gc/LUA_GCSTEP changed to 'size_t' 2024-09-10 17:05:39 -03:00
lcode.c 'expdesc' doesn't depend on 'actvar' for var. info. 2025-05-11 11:51:58 -03:00
lcode.h Function 'luaK_semerror' made vararg 2025-04-17 14:58:55 -03:00
lcorolib.c The main thread cannot be closed 2025-06-13 14:08:38 -03:00
lctype.c Details (comments) 2025-07-07 15:02:09 -03:00
lctype.h Better documentation for 'lctype.h' 2020-09-03 09:52:43 -03:00
ldblib.c Debug information about extra arguments from __call 2024-11-19 14:09:18 -03:00
ldebug.c Detail 2025-05-16 15:20:32 -03:00
ldebug.h Bug: Call hook may be called twice when count hook yields 2023-07-25 16:50:44 -03:00
ldo.c LUAI_MAXSTACK defined privately 2025-07-01 10:57:02 -03:00
ldo.h A coroutine can close itself 2025-06-12 11:15:09 -03:00
ldump.c Dump uses varints also for integer constants 2025-06-13 14:14:50 -03:00
lfunc.c New macro 'l_numbits' 2025-03-27 12:38:29 -03:00
lfunc.h New type 'TStatus' for thread status/error codes 2025-01-30 11:41:39 -03:00
lgc.c New metatable in an all-weak table can fool the GC 2025-06-16 16:29:32 -03:00
lgc.h Detail (debugging aid) 2025-01-06 12:41:39 -03:00
linit.c llimits.h being used by all Lua code 2024-06-20 14:46:06 -03:00
liolib.c Tiny refactoring in io.flush 2025-04-03 12:56:52 -03:00
ljumptab.h Several details about 5.4.0 rc1 2020-04-23 14:48:15 -03:00
llex.c Slightly faster way to check for "global" 2025-05-16 14:51:07 -03:00
llex.h Slightly faster way to check for "global" 2025-05-16 14:51:07 -03:00
llimits.h Janitorial work on casts 2025-05-08 15:18:57 -03:00
lmathlib.c Small optimization in 'project' from math.random 2025-03-27 15:22:40 -03:00
lmem.c GC back to controling pace counting bytes 2024-09-19 19:02:14 -03:00
lmem.h Array sizes in undump changed from unsigned to int 2025-02-20 10:09:04 -03:00
loadlib.c Short strings can be external, too 2025-07-15 14:40:27 -03:00
lobject.c Randomness added to table length computation 2025-07-18 16:18:30 -03:00
lobject.h Short strings can be external, too 2025-07-15 14:40:27 -03:00
lopcodes.c Details 2024-09-06 14:35:04 -03:00
lopcodes.h Bug: check for constructor overflow in [exp] fields 2025-05-20 17:50:56 -03:00
lopnames.h Several details about 5.4.0 rc1 2020-04-23 14:48:15 -03:00
loslib.c Warning in loslib.c (signed-unsigned comparison) 2025-06-27 14:47:11 -03:00
lparser.c Optional initialization for global declarations 2025-07-08 13:33:57 -03:00
lparser.h No need to limit variable declarations to 250 2025-06-18 16:45:55 -03:00
lprefix.h Several details about 5.4.0 rc1 2020-04-23 14:48:15 -03:00
lstate.c A coroutine can close itself 2025-06-12 11:15:09 -03:00
lstate.h Correction in definition of CIST_FRESH 2025-07-07 15:03:45 -03:00
lstring.c Short strings can be external, too 2025-07-15 14:40:27 -03:00
lstring.h Short strings can be external, too 2025-07-15 14:40:27 -03:00
lstrlib.c Fix in string.rep 2025-07-23 18:12:53 -03:00
ltable.c Randomness added to table length computation 2025-07-18 16:18:30 -03:00
ltable.h Randomness added to table length computation 2025-07-18 16:18:30 -03:00
ltablib.c Parameters for 'lua_createtable' back to int 2025-01-21 13:33:59 -03:00
ltests.c Short strings can be external, too 2025-07-15 14:40:27 -03:00
ltests.h LUAI_MAXSTACK defined privately 2025-07-01 10:57:02 -03:00
ltm.c Added gcc option '-Wconversion' 2024-07-27 13:32:59 -03:00
ltm.h Added gcc option '-Wconversion' 2024-07-27 13:32:59 -03:00
lua.c lua.c doesn't use function pointers with LUA_READLINE 2025-07-09 14:43:31 -03:00
lua.h LUAI_MAXSTACK defined privately 2025-07-01 10:57:02 -03:00
luaconf.h Details (comments) 2025-07-07 15:02:09 -03:00
lualib.h New interface to function 'luaL_openselectedlibs' 2024-02-15 11:17:39 -03:00
lundump.c Added missing casts from lua_Unsigned to size_t 2025-07-01 16:07:03 -03:00
lundump.h Checks for type 'int' added to binary header 2025-03-10 15:21:32 -03:00
lutf8lib.c Correction in utf8.offset 2025-07-18 16:10:28 -03:00
lvm.c Randomness added to table length computation 2025-07-18 16:18:30 -03:00
lvm.h Details 2025-01-16 11:51:16 -03:00
lzio.c Cleaning of llimits.h 2024-06-20 13:43:33 -03:00
lzio.h Added gcc option '-Wconversion' 2024-07-27 13:32:59 -03:00
makefile Fixed conversion warnings from clang 2025-01-14 16:24:46 -03:00
onelua.c Details 2023-03-09 11:12:11 -03:00
README.md Details 2020-12-02 15:13:13 -03:00

Lua

This is the repository of Lua development code, as seen by the Lua team. It contains the full history of all commits but is mirrored irregularly. For complete information about Lua, visit Lua.org.

Please do not send pull requests. To report issues, post a message to the Lua mailing list.

Download official Lua releases from Lua.org.