Re: Specially crafted binary chunks can cause Lua to crash
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Specially crafted binary chunks can cause Lua to crash
- From: David Given <dg@...>
- Date: 2008年3月27日 18:01:20 +0000
Luiz Henrique de Figueiredo wrote:
And we'll probably fix this
Here is the fix:
I find myself using something I've dubbed the 'normalise' operator quite
a lot in C and C++ --- !!.
bool convert_to_bool(int i)
{
return !!i; // equivalent to (i ? true : false)
}
Yes, I know it's just two boolean nots one after the other, but it's
sufficiently useful and IMO sufficiently atomic that it's worth thinking
of as a primitive operation.
--
David Given
dg@cowlark.com
- References:
- Re: Specially crafted binary chunks can cause Lua to crash, Luiz Henrique de Figueiredo
- Re: Specially crafted binary chunks can cause Lua to crash, Peter Cawley
- Re: Specially crafted binary chunks can cause Lua to crash, Roberto Ierusalimschy
- Re: Specially crafted binary chunks can cause Lua to crash, Peter Cawley
- Re: Specially crafted binary chunks can cause Lua to crash, Roberto Ierusalimschy
- Re: Specially crafted binary chunks can cause Lua to crash, Peter Cawley
- Re: Specially crafted binary chunks can cause Lua to crash, Greg Falcon
- Re: Specially crafted binary chunks can cause Lua to crash, Luiz Henrique de Figueiredo
- Re: Specially crafted binary chunks can cause Lua to crash, Ben Sunshine-Hill
- Re: Specially crafted binary chunks can cause Lua to crash, Luiz Henrique de Figueiredo
- Re: Specially crafted binary chunks can cause Lua to crash, Luiz Henrique de Figueiredo