79817567

Date: 2025-11-12 09:55:30
Score: 1.5
Natty:
Report link

You're copying into the wrong address.

pMyStringAdress is a pointer that holds the heap address returned by VirtualAlloc.

But you used &pMyStringAdress (the address of the pointer variable on the stack) both when printing and in memcpy. That writes past the pointer variable itself and trashes the stack -> "Run-Time Check Failure #2 … stack … was corrupted."

- Fixes

Use pMyStringAdress (no &) when printing and copying.

Free with VirtualFree when done.

Minor: use the right printf specifiers.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: muraya