mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00: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
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue