diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp index 9899d47c23..04e4bef4cd 100644 --- a/src/corelib/codecs/qgb18030codec.cpp +++ b/src/corelib/codecs/qgb18030codec.cpp @@ -317,7 +317,7 @@ QList QGbkCodec::_aliases() QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *state) const { - uchar buf[2]; + uchar buf[2] = {0, 0}; int nbuf = 0; ushort replacement = QChar::ReplacementCharacter; if (state) { @@ -467,7 +467,7 @@ QByteArray QGb2312Codec::_name() QString QGb2312Codec::convertToUnicode(const char* chars, int len, ConverterState *state) const { - uchar buf[2]; + uchar buf[2] = {0, 0}; int nbuf = 0; ushort replacement = QChar::ReplacementCharacter; if (state) {