I just came across a code similar to the following that looks suspicious to me (details are not provided to protect the innocent):
std::string MakeString() { char buf[12] = { 0 }; return &buf[0]; }
Is this normal or unsafe? Is it guaranteed that std :: string is created before buf goes out of scope?
source share