So here I believe I have a small buffer overflow problem I found when reviewing someone else\'s code. It immediately struck me as incorrect, and potentially dangerous, but a
Your assessment is correct. [edit] with the addition of the correction mentioned by James Curran.[/edit]
Likely, your test app didn't show the problem because the allocation is rounded up to the next multiple of 4, 8 or 16 (which are common allocation granularities).
This means you should be able to demonstrate with a 31 character long string.
Alternatively, use an "instrumenting" native memory profiler that can place guard bytes closely around such an allocation.