lua-users home
lua-l archive

Re: Specially crafted binary chunks can cause Lua to crash

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


Another minor issue: LoadConstants() in the boolean case does not
validate that the byte read represents a boolean. Bytes greater than
1 should probably generate errors (or else coerce to 1). As it
stands, loadstring() can be abused to create a boolean that is neither
true nor false.
> maybe = loadstring(string.dump(function() return ({[true]=true})[true] end):gsub('1円1円','1円2円'))()
> = type(maybe)
boolean
> = maybe==true, maybe==false
false false
Greg F

AltStyle によって変換されたページ (->オリジナル) /