Oberon00 / luabind

Luabind is a library that helps you create bindings between C++ and Lua.
http://oberon00.github.io/luabind/
Other
46 stars 13 forks source link

function candidate buffer overrun #25

Closed lartom closed 9 years ago

lartom commented 9 years ago

Hello, In call.hpp the candidates arrary is set to 10 for the invoke_context struct but the invoke_normal() function in the same file has no knowledge of that and happily writes over the invoke_context.candidate_index variable when there's more than 10 possible function candidates causing a crash next iteration

else if (score == ctx.best_score)
{
    ctx.candidates[ctx.candidate_index++] = &self; // after 10 iterations candidate_index == &self
}

It happens when you bind more then 10 functions with the same name but different argument type.

Oberon00 commented 9 years ago

Thanks for reporting!