소스 검색

fix off by one

zricethezav 5 년 전
부모
커밋
ede68fd95d
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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++
 		}