mirror of
https://github.com/securego/gosec.git
synced 2025-11-27 22:28:20 +02:00
Add a rule which detects when there is potential integer overflow (#422)
* Add G109(Potential Integer OverFlow Detection) Signed-off-by: Hiroki Suezawa <suezawa@gmail.com> * add CWE to G109(Potential Integer Overflow) Signed-off-by: Hiroki Suezawa <suezawa@gmail.com> * Modify G109 to use gosec.Context Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
This commit is contained in:
committed by
Cosmin Cojocar
parent
f43a957359
commit
9cb83e10af
@@ -83,6 +83,10 @@ var _ = Describe("gosec rules", func() {
|
||||
runner("G108", testutils.SampleCodeG108)
|
||||
})
|
||||
|
||||
It("should detect integer overflow", func() {
|
||||
runner("G109", testutils.SampleCodeG109)
|
||||
})
|
||||
|
||||
It("should detect sql injection via format strings", func() {
|
||||
runner("G201", testutils.SampleCodeG201)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user