Fix int convertion cve (#25)

This commit is contained in:
Yang
2022-11-04 15:31:34 +08:00
committed by GitHub
parent a525fcb1b5
commit 31b78bf40c
4 changed files with 66 additions and 11 deletions

View File

@@ -95,7 +95,7 @@ func (f fallback) Parse(annotations Annotations, config *Ingress, globalContext
codesStr := splitBySeparator(codes, ",")
var codesUint32 []uint32
for _, rawCode := range codesStr {
code, err := strconv.Atoi(rawCode)
code, err := strconv.ParseUint(rawCode, 10, 32)
if err != nil {
IngressLog.Errorf("Custom HTTP code %s within ingress %s/%s is invalid", rawCode, config.Namespace, config.Name)
continue