Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aaaa
25 changes: 25 additions & 0 deletions c_security_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#define MAX_BUFFER 10

void buffer_overflow_vuln(char* user_input) {
char buffer[MAX_BUFFER];
strcpy(buffer, user_input);
}


int integer_overflow_vuln(int count, int size) {
int total_bytes = count * size;
return total_bytes;
}


int main(int argc, char* argv[]) {
buffer_overflow_vuln(argv[1]);
int result = integer_overflow_vuln(INT_MAX, 2);
return 0;
}