1
0
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:
Hiroki Suezawa
2020-01-06 17:55:52 +09:00
committed by Cosmin Cojocar
parent f43a957359
commit 9cb83e10af
9 changed files with 191 additions and 18 deletions

View File

@@ -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)
})