diff --git a/samples/cpp/bad.cpp b/samples/cpp/bad.cpp new file mode 100644 index 000000000000..833d439adc9b --- /dev/null +++ b/samples/cpp/bad.cpp @@ -0,0 +1,7 @@ +#include + +int badFunction() { + char str[20]; + gets(str); // Noncompliant; `str` buffer size is not checked and it is vulnerable to overflows + return 0; +}