Parcourir la source

fix off by one

zricethezav il y a 5 ans
Parent
commit
ede68fd95d
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      scan/rule.go

+ 3 - 0
scan/rule.go

@@ -249,6 +249,9 @@ func extractAndInjectLineNumber(leak *manager.Leak, bundle *Bundle, repo *Repo)
 					return
 				}
 				currLine = 0
+				if !strings.HasSuffix(txt, diffLineSignature) {
+					currLine = -1
+				}
 			}
 			currLine++
 		}