[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: segfault in lua(L)_getmetatable on invalid stack index
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 7 Jul 2003 09:04:32 -0300
>calling lua_getmetatable() on a stack index that is greater than lua_gettop() produces a segfault when lua_getmetatable() dereferences a null pointer returned by luaA_indexAcceptable().
The C API does not check the validity of the operations. It's assumed that
C programmers know what they are doing. The standard C library does the same.
>fh = io.open("somefile.txt")
>fh.read() -- with no arguments, including no self, segfaults
This is a known bug. See http://www.lua.org/bugs.html for a fix.
--lhf