1
0
mirror of https://github.com/securego/gosec.git synced 2025-07-15 01:04:43 +02:00

Add a new rule to detect integer overflow on integer types conversion

Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
This commit is contained in:
Cosmin Cojocar
2024-05-27 11:46:36 +01:00
parent 5f0084eb01
commit 4bf5667f66
6 changed files with 263 additions and 6 deletions

View File

@ -38,6 +38,7 @@ type SSAAnalyzerResult struct {
// BuildDefaultAnalyzers returns the default list of analyzers
func BuildDefaultAnalyzers() []*analysis.Analyzer {
return []*analysis.Analyzer{
newConversionOverflowAnalyzer("G115", "Type conversion which leads to integer overflow"),
newSliceBoundsAnalyzer("G602", "Possible slice bounds out of range"),
}
}