1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibMarkdown: Reset offset to 0 on each new List line

Found by FuzzMarkdown.
This commit is contained in:
Nico Weber 2020-07-13 15:20:29 -04:00 committed by Andreas Kling
parent c22790adb2
commit 1dfae92eac

View file

@ -142,8 +142,10 @@ OwnPtr<List> List::parse(Vector<StringView>::ConstIterator& lines)
first = false;
if (!item_builder.is_empty())
item_builder.append(' ');
ASSERT(offset <= line.length());
item_builder.append(line.substring_view(offset, line.length() - offset));
++lines;
offset = 0;
}
if (!flush_item_if_needed() || first)