diff options
author | Nico Weber <thakis@chromium.org> | 2020-07-13 15:20:29 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-14 17:45:16 +0200 |
commit | 1dfae92eac791f544df425d7fcdf30f169a729c3 (patch) | |
tree | c34d9b89eae20c01bc37481043c95c86a307cab3 /Libraries | |
parent | c22790adb24215cd9c8a6e3e27a40c5a62a8c93c (diff) | |
download | serenity-1dfae92eac791f544df425d7fcdf30f169a729c3.zip |
LibMarkdown: Reset offset to 0 on each new List line
Found by FuzzMarkdown.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibMarkdown/List.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibMarkdown/List.cpp b/Libraries/LibMarkdown/List.cpp index 15cd47d80a..52bc2816fe 100644 --- a/Libraries/LibMarkdown/List.cpp +++ b/Libraries/LibMarkdown/List.cpp @@ -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) |