summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index e9b7b9a..eff87e8 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -3227,7 +3227,7 @@ QString QString::section(const QRegExp &reg, 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 &section = sections.at(first_i);
ret.prepend(section.string.left(section.length));
}