mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 20:31:23 +00:00
[Lua] Avoid infinite loop when creating empty string (#6614)
* [Lua] Avoid infinite loop when creating empty string * [Lua] Check empty string output
This commit is contained in:
@@ -50,7 +50,10 @@ function mt:Slice(startPos, endPos)
|
||||
-- updated the startPos based on the size of the
|
||||
-- value
|
||||
while startPos < endPos do
|
||||
local v = d[startPos] or '/0'
|
||||
local v = d[startPos]
|
||||
if not v or v == "" then
|
||||
v = '/0'
|
||||
end
|
||||
table.insert(b, v)
|
||||
startPos = startPos + #v
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user