mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
AK: Skip over initial empty chunks in DisjointChunks
This will be caught by new test cases: when the initial chunk is empty, a dereference before calling operator++ on the iterator will crash as the initial chunk's size is never checked.
This commit is contained in:
parent
4ec599aae5
commit
7e18e6e37b
Notes:
sideshowbarker
2024-07-17 18:11:37 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/7e18e6e37b Pull-request: https://github.com/SerenityOS/serenity/pull/12733
@ -24,6 +24,8 @@ struct DisjointIterator {
|
|||||||
DisjointIterator(ReferenceType chunks)
|
DisjointIterator(ReferenceType chunks)
|
||||||
: m_chunks(chunks)
|
: m_chunks(chunks)
|
||||||
{
|
{
|
||||||
|
while (m_chunk_index < m_chunks.size() && m_chunks[m_chunk_index].is_empty())
|
||||||
|
++m_chunk_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisjointIterator(ReferenceType chunks, EndTag)
|
DisjointIterator(ReferenceType chunks, EndTag)
|
||||||
|
Loading…
Reference in New Issue
Block a user