mirror of
https://github.com/securego/gosec.git
synced 2025-11-29 22:37:59 +02:00
Feature: G602 Slice Bound Checking (#973)
* Added slice bounds testing for slice expressions. * Added checking slice index. * Added test for reassigning slice. * Store capacities on reslicing. * Scope change clears map. Func name used to track slices. * Map CallExpr to check bounds when passing to functions. * Fixed linter errors. * Updated rulelist with CWE mapping. * Added comment for NewSliceBoundCheck. * Addressed nil cap runtime error. * Replaced usage of nil in call arg map with dummy callexprs. * Updated comments, wrapped error return, addressed other review concerns.
This commit is contained in:
@@ -87,6 +87,7 @@ var ruleToCWE = map[string]string{
|
||||
"G504": "327",
|
||||
"G505": "327",
|
||||
"G601": "118",
|
||||
"G602": "118",
|
||||
}
|
||||
|
||||
// Issue is returned by a gosec rule if it discovers an issue with the scanned code.
|
||||
|
||||
Reference in New Issue
Block a user