Is writing to an already freed memory a vulnerability? x = malloc(200); /* do something with x / free (x); / do something else */ strcpy(x, “somedata”);
Overwriting freed memory is a security vulnerability
Depends on the application and how important “somedata” is
This will result in a buffer overflow since the freed memory location cannot handle 8 characters of data “somedata”
strcpy() will fail as it cannot write to already freed memory, and the application will crash