diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp index 60dad31a3eb..bb531e53811 100644 --- a/src/corelib/io/qurlrecode.cpp +++ b/src/corelib/io/qurlrecode.cpp @@ -255,7 +255,9 @@ struct QUrlUtf8Traits : public QUtf8BaseTraitsNoAscii static bool encodedUtf8ToUtf16(QString &result, char16_t *&output, const char16_t *begin, const char16_t *&input, const char16_t *end, char16_t decoded) { - char32_t ucs4 = 0, *dst = &ucs4; + char32_t buffer[1]; + char32_t &ucs4 = buffer[0]; + char32_t *dst = buffer; const char16_t *src = input + 3;// skip the %XX that yielded \a decoded int charsNeeded = QUtf8Functions::fromUtf8(decoded, dst, src, end); if (charsNeeded < 0)