[Bug c++/67942] diagnose placement new buffer overflow
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Oct 12 18:20:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67942
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
A patch capable of detecting and diagnosing a limited subset of such overflows
will be posted for review shortly. The output of the patch for the example
program in the Description is as follows:
$ g++ -Wall u.cpp
u.cpp: In function ‘void f(S*)’:
u.cpp:22:27: warning: placement new constructing a 16-byte object of type ‘S’
in a region of type ‘char [8]’ that is 8 bytes large
S *t = new (buf) S (*s);
More information about the Gcc-bugs
mailing list