mirror of
https://github.com/securego/gosec.git
synced 2025-07-15 01:04:43 +02:00
Fix false positive in conversion overflow check from uint8/int8 type
Change-Id: I543545e22fa12de0d85dcf92664a0a54e8f7244a Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
This commit is contained in:
committed by
Cosmin Cojocar
parent
a39ec5a16b
commit
ab3f6c1c83
@ -76,7 +76,7 @@ type integer struct {
|
||||
}
|
||||
|
||||
func parseIntType(intType string) (integer, error) {
|
||||
re := regexp.MustCompile(`(?P<type>u?int)(?P<size>\d{2})?`)
|
||||
re := regexp.MustCompile(`(?P<type>u?int)(?P<size>\d{1,2})?`)
|
||||
matches := re.FindStringSubmatch(intType)
|
||||
if matches == nil {
|
||||
return integer{}, fmt.Errorf("no integer type match found for %s", intType)
|
||||
|
Reference in New Issue
Block a user