Skip to content

Commit 3195fc5

Browse files
committed
stats_engine: limit cycle surrounding lines
Change-Id: Iffb2d515101635cff5ee33949b704d51a1205d90
1 parent 36c3b1e commit 3195fc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stats_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def collect_stats(kernel_repo, cve_patch):
176176
# check the surrounding lines
177177
fp_above = []
178178
idx = i - 1
179-
while len(fp_above) < len(above):
179+
while abs(idx) <= len(fp_contents) and len(fp_above) < len(above):
180180
above_candidate = fp_contents[idx]
181181
if above_candidate not in all_added:
182182
fp_above.append(above_candidate)

0 commit comments

Comments
 (0)