[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Bug in lfs.attributes
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 11 Oct 2009 12:10:55 -0300
> But it assumes that the table is the last argument passed to the
> function. Specifically it calls lua_rawset (L, -3) in the final for
> loop without having previously made sure the table is on the top of
> the stack (with pushvalue or settop). So if you pass additionnal
> parameters to lfs.attributes, lua_rawset is then called on the last
> value, and if it's not a table it can even segfault (had someone make
> the test with nil).
I've been bitten by this kind of bug more than twice. This is definitely
something to keep in mind when using the C API.