1#include <stdlib.h> 2#include <string.h> 3 4int main(void) 5{ 6 char buf[10]; 7 char *p; 8 /* no init */ 9 strcat(buf, "al"); 10 /* overflow */ 11 buf[11] = 'a'; 12 p = malloc(70); 13 p[10] = 5; 14 free(p); 15 /* write after free */ 16 p[1] = 'a'; 17 p = malloc(10); 18 /* memory leak */ 19 p = malloc(10); 20 /* underrun */ 21 p--; 22 *p = 'a'; 23 return 0; 24} 25 26 27 28