--- src/corelib/codecs/qutfcodec.cpp
+++ src/corelib/codecs/qutfcodec.cpp
@@ -140,7 +140,7 @@ void QUtf8Codec::convertToUnicode(QString *target, const char *chars, int len, C
 
     int originalLength = target->length();
     QString &result = *target;
-    result.resize(originalLength + len); // worst case
+    result.resize(originalLength + len + 1); // worst case
     QChar *qch = result.data() + originalLength;
     uchar ch;
     int invalid = 0;
