aboutsummaryrefslogtreecommitdiff
path: root/slides/2018-software-security/sample/bad-call.c
blob: 9d6d57b9db4391923a4f5d18be9e7b487680f7a9 (plain)
1
2
3
4
5
6
7
8
9
10
void init(char v, char *buf, int n)
{
  char *b = buf;
  while (b < buf+n) {
    *b++ = val;
  }
}
...
char *buf = malloc(2);
init('A', buf, sizeof(buf));