Skip to content

Fix potential out-of-bounds access in unfoldHeaders() for invalid input

The current code failed for input starting with (optionally) spaces and a line break. This shouldn't actually happen under normal circumstances, but the Qt6 build somehow manages to feed this into here.

As foldBegin is already checked for being null in the outside loop, the inner loop condition was basically always true here, so this will read outside of the input of we start with spaces.

Merge request reports