lua-users home
lua-l archive

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


>       if( !lua_getmetatable( L, index ) )
>           return NULL;
>       lua_pushlightuserdata( L, udkey );      /* ( ... mt udkey )
>       lua_rawget( L, -2 );                    /* ( ... mt mt[ udkey ] )

This technique is not safe. A Lua program may get udkey (traversing the
metatable of a userdata) and then add it as a key in the metatable of a
userdata from a different kind, fooling checkudata.

-- Roberto