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

int main(int argc, char *argv[])
{
  verify_heap();
  return 0;
}