diff options
Diffstat (limited to 'slides/2018-software-security/sample/_bo-heap.c')
-rw-r--r-- | slides/2018-software-security/sample/_bo-heap.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/slides/2018-software-security/sample/_bo-heap.c b/slides/2018-software-security/sample/_bo-heap.c new file mode 100644 index 0000000..a89959c --- /dev/null +++ b/slides/2018-software-security/sample/_bo-heap.c @@ -0,0 +1,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; +} |