moai/luamongo — pull request #5 by neoxic (2012-01-19 16:38:27+00:00)
Title: BSON.BinData support, consistency & security fixes

+ Add support for BSON.BinData
+ Add cyclic table reference checks in BSON building (infinite recursion)
+ Consistency & security checks:
* Avoid long jumps from luaL_error which caused memory leaks (structures on the stack are not destructed)
* Check string pointers before use to avoid segfaults on bad input
* Check Lua stack size to allow safe nested table traversing
+ Minor makeup