Explorar el Código

Fixed bug in extractLine function which was returning incorrect line # when the line contains multiple vuln types

Matthew E. Grahlman hace 4 años
padre
commit
d8e3a694f2
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      scan/utils.go

+ 2 - 0
scan/utils.go

@@ -212,6 +212,8 @@ func extractLine(patchContent string, leak Leak, lineLookup map[string]bool) int
 			if _, ok := lineLookup[fmt.Sprintf("%s%s%d%s", leak.Offender, leak.Line, lineNumber, leak.File)]; !ok {
 				lineLookup[fmt.Sprintf("%s%s%d%s", leak.Offender, leak.Line, lineNumber, leak.File)] = true
 				return lineNumber
+			} else if ok {
+				return lineNumber
 			}
 		}
 		currLine++