author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Mon, 28 Sep 2015 00:00:45 +0100 | |
changeset 386 | 3c69029f4a1c |
parent 208 | 204564b899a0 |
permissions | -rw-r--r-- |
207
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
#include <string.h> |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
#include <stdio.h> |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
#include <stdlib.h> |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
|
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
void foo (char *bar) |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
{ |
208
204564b899a0
progs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
7 |
long my_long = 101010101; // in hex: \xB5\x4A\x05\x06 |
207
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
} |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
|
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
int main (int argc, char **argv) |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
{ |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
foo("my string is too long !!!!!"); // all is normal |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
foo("my string is too long !!!!! \x15\xcd\x5b\x07"); // overwrites my_long |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
return 0; |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
} |
e74a45933842
test
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |