1
0
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:
Cosmin Cojocar
2024-08-22 07:41:27 +00:00
committed by Cosmin Cojocar
parent a39ec5a16b
commit ab3f6c1c83
2 changed files with 31 additions and 1 deletions

View File

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