lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Nov 27, 2018 at 10:30 AM Soni L. <fakedme@gmail.com> wrote:
>
> I am concerned about an attacker setting a __gc metamethod that loops forever and can't be broken.

How a recursive/renetrant GC can solve this issue? The first example I
can think of a "__gc metamethod that loops forever and can't be
broken" is:

```
local x = {}
setmetatable({},{__gc=fucntion()
  while true do
    x[#x+1] = {} -- Not necessary, but funny
  end
end}
```