From 8976539177a1c2648da4c0843a52c8eceb92b15f Mon Sep 17 00:00:00 2001 From: Gian Miguel Del Mundo Date: Wed, 30 Aug 2023 00:09:47 +0800 Subject: [PATCH] Fixed lineEnd indexing if the match is the whole line (#1223) --- detect/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect/utils.go b/detect/utils.go index 7b2c0d21..16ca6f41 100644 --- a/detect/utils.go +++ b/detect/utils.go @@ -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:]