aboutsummaryrefslogtreecommitdiff
path: root/slides/2018-software-security/demo/simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'slides/2018-software-security/demo/simple.c')
-rw-r--r--slides/2018-software-security/demo/simple.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/slides/2018-software-security/demo/simple.c b/slides/2018-software-security/demo/simple.c
new file mode 100644
index 0000000..cd07c07
--- /dev/null
+++ b/slides/2018-software-security/demo/simple.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdlib.h>
+
+void fun() {
+ printf("fun times!\n");
+}
+
+void mul(int first) {
+ int second = 0;
+ char buf[8] = {1,2,3,4,5,6,7,8};
+ printf("Enter a number: ");
+ gets(buf);
+ second = atoi(buf);
+ printf("%d*%d = %d\n", first, second, first*second);
+}
+
+int main() {
+ int first = 2;
+ mul(first);
+ return 0;
+}