Commit 774ff955 authored by Milian Wolff's avatar Milian Wolff
Browse files

Verify that ParamIterator never goes past the end

Check whether the iterator is valid before advancing it further
and also verify that we don't deref it when it's invalid.
parent 2c426653
......@@ -629,6 +629,8 @@ ParamIterator& ParamIterator::operator ++()
{
Q_D(ParamIterator);
Q_ASSERT(*this);
if (d->m_source[d->m_curEnd] == d->m_parens[1]) {
//We have reached the end-paren. Stop iterating.
d->m_cur = d->m_end = d->m_curEnd + 1;
......@@ -646,6 +648,8 @@ QString ParamIterator::operator *()
{
Q_D(ParamIterator);
Q_ASSERT(*this);
return d->m_source.mid(d->m_cur, d->m_curEnd - d->m_cur).trimmed();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment