diff --git a/C++/buffer_overflow.cpp b/C++/buffer_overflow.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8b3f71f00f1ad9992099ed1f4cda92e8afa2ba91 --- /dev/null +++ b/C++/buffer_overflow.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + // this exception may happen when we use the log to print array + // In asan, we will get the exception + char foo[5] = {'H','E','L','L','O'}; + printf("%s\n", foo); +} \ No newline at end of file