An article of manufacture comprising a computer readable storage medium comprising program code tangibly embodied thereon, which when executed by a computer, performs method steps for protecting from buffer overflow vulnerability due to placement new constructs, the method steps comprising:
- determining whether an instruction in a program is a placement new instruction which would result in an object overwriting contents in a memory area;
- and
- selecting a method for preventing buffer overflow if it is determined that the instruction is the placement new instruction which would result in the object overwriting the contents in the memory area.