mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +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
Notes:
sideshowbarker
2024-07-17 18:11:37 +09:00
Author: https://github.com/kleinesfilmroellchen
Commit: 7e18e6e37b
Pull-request: https://github.com/SerenityOS/serenity/pull/12733
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