From: Vadim Zeitlin Date: Mon, 30 Jul 2012 11:39:08 +0000 (+0000) Subject: Fix the size of the buffer passed to wxTmemcpy() in wxTextDataObject. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/73ed2b2b12d0d58e58b016eff705dd9f49293929 Fix the size of the buffer passed to wxTmemcpy() in wxTextDataObject. This corrects fatal bug introduced in r72259: we must not multiply the string length by sizeof(wxChar) as wxTmemcpy() does this internally. See #14444. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index 0eeea52fb2..7925041420 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -425,8 +425,8 @@ bool wxTextDataObject::GetDataHere(void *buf) const // NOTE: use wxTmemcpy() instead of wxStrncpy() to allow // retrieval of strings with embedded NULLs wxTmemcpy(static_cast(buf), - textNative.c_str(), - (textNative.length() + 1)*sizeof(wxChar)); + textNative.t_str(), + textNative.length() + 1); return true; }