This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53330] new() operator can return NULL on a zero-length allocation
- From: "kilobyte at angband dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 12 May 2012 11:01:23 +0000
- Subject: [Bug c++/53330] new() operator can return NULL on a zero-length allocation
- Auto-submitted: auto-generated
- References: <bug-53330-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53330
--- Comment #1 from Adam Borowski <kilobyte at angband dot pl> 2012-05-12 11:01:23 UTC ---
Correction: after testing with valgrind, the return value is indeed
uninitialized; the pointer in contructor-but-no-fields case happens to be
non-zero but is junk and will cause a crash when you try to free it.