Skip to content

Commit

Permalink
fix: limit codeline_index to avoid exceeding lines array size
Browse files Browse the repository at this point in the history
cc #428

Signed-off-by: ksg <[email protected]>
  • Loading branch information
ksg97031 committed Oct 26, 2024
1 parent 9e7e61e commit 8981e56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/analyzer/analyzers/python/flask.cr
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ module Analyzer::Python
codeline_index += (direction == :down ? 1 : -1)
end

return params, codeline_index
return params, [lines.size-1, codeline_index].min
end

# Function to extract namespace from the parser and update the prefix
Expand Down

0 comments on commit 8981e56

Please sign in to comment.