Skip to content

Commit c2edfec

Browse files
committed
tests/lapi: fix table_remove_test
Fix out-of-bound indices passed to `table.remove()`.
1 parent 51d08cf commit c2edfec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/lapi/table_remove_test.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ local test_lib = require("lib")
1616

1717
local function TestOneInput(buf, _size)
1818
local fdp = luzer.FuzzedDataProvider(buf)
19-
local count = fdp:consume_integer(0, test_lib.MAX_INT)
19+
local count = fdp:consume_integer(1, test_lib.MAX_INT)
2020
local tbl = fdp:consume_strings(test_lib.MAX_STR_LEN, count)
2121

2222
local indices_count = fdp:consume_integer(0, #tbl)
23-
local indices = fdp:consume_integers(0, count, indices_count)
23+
local indices = fdp:consume_integers(1, count, indices_count)
2424
for _, idx in ipairs(indices) do
2525
local old_v = tbl[idx]
2626
assert(table.remove(tbl, idx) == old_v)

0 commit comments

Comments
 (0)