[태그:] Heap

Heap 오버플로우 스터디

OS : Red Hat Linux 6.2 heap.c #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { FILE *fd; // Allocating memory on the heap char *userinput = malloc(20); char *outputfile = malloc(20); if(argc < 2) { printf("Usage: %s <string to be written to /tmp/notes>\n", argv[0]); exit(0); } // Copy data into heap memory strcpy(outputfile, …