Vulnerable Heap Overflow Code
// heap.c
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[] {
char *buf1 = malloc(300);
char *buf2 = malloc(20);
strcpy(buf1, argv[1]);
free(buf1);
free(buf2);
return 0;
}