Skip to content

CodeIntelligenceTesting/c-cpp-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Intelligence logo

Testing C/C++ for Security and Reliability

Building robust C/C++ applications is a highly challenging endeavor that requires thorough testing. While C/C++ enables us to write high-performance code, the memory-unsafety nature of the language brings a broad spectrum of security risks. Memory corruption issues constitute the vast majority of bugs and security vulnerabilities found in C/C++ projects, and their impact is best demonstrated by the Heartbleed bug on OpenSSL. Regular unit and integration tests are essential to test that our code functions correctly, they are not enough to uncover memory-corruption bugs. On the other hand, fuzz testing has established itself as the best practical method to find these issues in large code bases such as Google Chrome.

In this example, we demonstrate how you can use CI Fuzz to integrate fuzz testing into your C/C++ projects. The example project uses CMake as the build system and contains the following three use cases:

  • Simple Checks Example: A simple example that triggers a buffer over when the input parameters satisfy certain criteria. We show that CI Fuzz can quickly generate a test case that trigger this bug.
  • Complex Checks Example: A more complex example that triggers a use-after-free bug when the input parameters satisfy certain criteria. In this example, the checks are more complex and involve Base64 encoding and XORing with constant value, making it more challenging to find the correct combination of input parameters that trigger the bug.
  • Automotive Example: An example that demonstrates the challenges of creating high-quality fuzz tests for complex projects with a large public API. We demonstrate how we can automate most of this task with CI Spark.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published