This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/48257] std::string::assign() corrupts std::string static data when called on emptyString1 using emptyString2.data()
- From: "mohsinrzaidi at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Mar 2011 10:24:17 -0000
- Subject: [Bug libstdc++/48257] std::string::assign() corrupts std::string static data when called on emptyString1 using emptyString2.data()
- Auto-submitted: auto-generated
- References: <bug-48257-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48257
--- Comment #11 from Mohsin <mohsinrzaidi at gmail dot com> 2011-03-24 10:24:15 UTC ---
(In reply to comment #10)
> Two questions here:
>
> 1. Is the behaviour undefined for __n < number of elements in __s?
>
Oops! I meant for __n > number of elements in __s.
>
> 2. For cases undefined in the specs, do we take steps to ensure robustness? I
> still cannot digest that a programmer error could corrupt std::string static
> memory.