diff -r dee5afe5301f -r 3f74d0d4af4c src/corelib/tools/qstring.cpp --- a/src/corelib/tools/qstring.cpp Mon Mar 15 12:43:09 2010 +0200 +++ b/src/corelib/tools/qstring.cpp Thu Apr 08 14:19:33 2010 +0300 @@ -3185,7 +3185,7 @@ 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)); }