summaryrefslogtreecommitdiff
path: root/src/stack1.c
blob: fdc2f14d7b7f9f9b0bdc70c156885a7c441b8902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>

// http://community.coresecurity.com/~gera/InsecureProgramming/stack1.html
//
int main(int argc, const char *argv[])
{
  int cookie;
  char buf[80];
  printf("buf: %08x cookie: %08x\n", &buf, &cookie);
  gets(buf);

  if (cookie == 0x41424344) {
    printf("you win!\n");
  }
  
  return 0;
}