diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-02 15:41:05 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-02 17:10:38 (GMT) |
commit | 7fc63dd0ff368a637dcd17e692b9d6b26278b538 (patch) | |
tree | e4535c4ebb615b52e347a97158efe40247f23a16 /src/corelib/tools/qstring.cpp | |
parent | 120905fbc48ac7658fac392113bf45e00880c456 (diff) | |
download | Qt-7fc63dd0ff368a637dcd17e692b9d6b26278b538.zip Qt-7fc63dd0ff368a637dcd17e692b9d6b26278b538.tar.gz Qt-7fc63dd0ff368a637dcd17e692b9d6b26278b538.tar.bz2 |
QString::section: Fix crash with SectionIncludeLeadingSep flag
And start is out of bounds.
Reviewed-by: Thiago
Reviewed-by: Joao
Task-number: QTBUG-4306
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3ef0e66..03bc053 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3185,7 +3185,7 @@ QString QString::section(const QRegExp ®, int start, int end, SectionFlags fl if (!empty || !(flags & SectionSkipEmpty)) x++; } - if((flags & SectionIncludeLeadingSep)) { + if((flags & SectionIncludeLeadingSep) && first_i < sections.size()) { const qt_section_chunk §ion = sections.at(first_i); ret.prepend(section.string.left(section.length)); } |