mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-14 21:47:13 +00:00
[PR #710] Add line count check to avoid out of range #1199
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/xoofx/markdig/pull/710
State: closed
Merged: Yes
IndexOutOfRangeException is thrown in StringLineGroup when calling Iterator.NextChar
8155a1e3d6/src/Markdig/Helpers/StringLineGroup.cs (L276)The exception occurs when trying to advance to the next line when the StringLineGroup is at capacity (capacity == line_count)
8155a1e3d6/src/Markdig/Helpers/StringLineGroup.cs (L339)This exception is kind of an edge case and does not happen often because
LeafBlockand other parts that use the StringLineGroup provision some extra capacity in advance and when capacity is needed it is increased by a factor of 2, so it's not very common that the needed capacity matches the line count.