Skip to content

Commit

Permalink
Fixed lineEnd indexing if the match is the whole line (gitleaks#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmsdelmundo authored Aug 29, 2023
1 parent 30c6117 commit 8976539
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion detect/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func printFinding(f report.Finding, noColor bool) {

lineEndIdx := matchInLineIDX + len(f.Match)
if len(f.Line)-1 <= lineEndIdx {
lineEndIdx = len(f.Line) - 1
lineEndIdx = len(f.Line)
}

lineEnd := f.Line[lineEndIdx:]
Expand Down

0 comments on commit 8976539

Please sign in to comment.