This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/48355] Assigning NULL to string segfaults
- From: "amr.ali.cc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Mar 2011 09:14:01 +0000
- Subject: [Bug libstdc++/48355] Assigning NULL to string segfaults
- Auto-submitted: auto-generated
- References: <bug-48355-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48355
--- Comment #3 from Amr Ali <amr.ali.cc at gmail dot com> 2011-03-30 09:13:57 UTC ---
(In reply to comment #2)
> duplicate of PR 5258 and PR 994
>
> I'll look into checking when _GLIBCXX_DEBUG is defined but the default
> (non-debug mode) behaviour is NOT going to change, your code has a bug, your
> code should change not the standard library
Yes, I'm not saying that what I'm doing is "right", I'm rather pointed out that
the code actually segfaults, which shouldn't happen even with a faulty value
like a NULL pointer.
I'm only suggesting that a check for a null pointer be present as in the
string() ctor case.