]> git.saurik.com Git - wxWidgets.git/commitdiff
properly NUL-terminate the buffer returned by wxMBConv::cMB2WC()
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Sep 2007 12:04:39 +0000 (12:04 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Sep 2007 12:04:39 +0000 (12:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/strconv.cpp

index 65f6cb7eeea5faeda51bb515ee5a2d1f0d50789f..f4731ceabee2e5203f1c1c7b0f46d2647d63a1fc 100644 (file)
@@ -395,6 +395,7 @@ wxMBConv::cMB2WC(const char *inBuff, size_t inLen, size_t *outLen) const
         // because we want the buffer to always be NUL-terminated, even if the
         // input isn't (as otherwise the caller has no way to know its length)
         wxWCharBuffer wbuf(dstLen);
+        wbuf.data()[dstLen - 1] = L'\0';
         if ( ToWChar(wbuf.data(), dstLen, inBuff, inLen) != wxCONV_FAILED )
         {
             if ( outLen )