| 203 | const uint32_t IOOB_BUFFER_SIZE = 8 + 2 + 2 + (sizeof(char) + sizeof(char) + 5 * sizeof(char) + sizeof(lua_Number)); |
| 204 | |
| 205 | static int ProduceIndexOutOfBounds(lua_State *L) |
| 206 | { |
| 207 | char DM_ALIGNED(16) buf[IOOB_BUFFER_SIZE]; |
| 208 | lua_newtable(L); |
| 209 | // invalid key |
| 210 | lua_pushnumber(L, 0xffffffffLL+1); |
| 211 | // value |
| 212 | lua_pushnumber(L, 0); |
| 213 | // store pair |
| 214 | lua_settable(L, -3); |
| 215 | uint32_t buffer_used = dmScript::CheckTable(L, buf, IOOB_BUFFER_SIZE, -1); |
| 216 | // expect it to fail, avoid warning |
| 217 | (void)buffer_used; |
| 218 | return 1; |
| 219 | } |
| 220 | |
| 221 | TEST_F(LuaTableTest, IndexOutOfBounds) |
| 222 | { |
nothing calls this directly
no test coverage detected