From 99ccb0e76ef162d0245a6d0549acae023963e70b Mon Sep 17 00:00:00 2001 From: joyfaker Date: Mon, 29 Dec 2025 16:05:02 +0800 Subject: [PATCH 1/2] Create a Signed-off-by: joyfaker --- a | 1 + 1 file changed, 1 insertion(+) create mode 100644 a diff --git a/a b/a new file mode 100644 index 0000000000..5d308e1d06 --- /dev/null +++ b/a @@ -0,0 +1 @@ +aaaa From c635333a3f71c812c3c3c5b10712f3b89c2065dd Mon Sep 17 00:00:00 2001 From: joyfaker Date: Mon, 29 Dec 2025 16:09:16 +0800 Subject: [PATCH 2/2] Add files via upload Signed-off-by: joyfaker --- c_security_test.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 c_security_test.c diff --git a/c_security_test.c b/c_security_test.c new file mode 100644 index 0000000000..b7f0defb01 --- /dev/null +++ b/c_security_test.c @@ -0,0 +1,25 @@ + +#include +#include +#include +#include + +#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; +} \ No newline at end of file