This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Tighten length error check in string::replace
Paolo Carlini wrote:
> Thinking more about this, I'm finding this bug pretty serious and
> would even ask for having the patch in 3.1.0, if still possible.
This is a testcase which currently /wrongly/ throws (aborts), and should
not (it doesn't with the patch applied):
#include <string>
int main()
{
std::string aa = "londinium";
std::string bb = "cydonia";
aa.replace(0, 20, bb.c_str(), 3);
}
Paolo.