Skip to content

Basic script to run scan-build on Golang code which uses cgo

Notifications You must be signed in to change notification settings

stevenjohnstone/cgo-scan-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scan-build for cgo

Golang can be extended by and integrated with C code using cgo. Unfortunately, this removes memory safety guarantees and inherits the dangerous traits of C code.

In modern secure software development, it's normal to run static analysis tools against C code. For example, Clang's scan-build is an excellent, open-source packaging of Clang's analysis tooling. In a perfect world, running

scan-build go build

would be enough to perform a scan. In the real world, this doesn't work but this script works around this limitation.

Usage

  1. Clone the repository
  2. In the checkout directory, run
./scan.sh <target code> <output directory>

Docker usage

  1. Clone the repository
  2. In the checkout directory, run
./docker.sh <target code> <output directory>

About

Basic script to run scan-build on Golang code which uses cgo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published