[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Preventing DOS when executing Lua code ...
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 4 Jul 2006 00:31:52 -0300
> My solution registers a hook function that executes based on the
> count hook. It checks the current time and if execution has timed
> out, it does a longjmp out of the interpreter and back into the host
> application.
Why not simply call lua_error instead of longjmp? If you run Lua in a
cpcall cage, you can catch that error in the host app. That's what lua.c
does. --lhf