aboutsummaryrefslogtreecommitdiff
path: root/slides/2018-software-security/sample/bo-heap.c
blob: 60fd29e3c0d091685d6e8719461345869cfbd068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
void verify_heap()
{
  char *buf = malloc(8*sizeof(char));
  int *verified = malloc(sizeof(int));
  *verified = 0;
  gets(buf);
  /* <verification goes here> */
  if (*verified) {
    printf("accept\n");
  } else {
    printf("reject\n");
  }
}