diff --git a/docs/changes.txt b/docs/changes.txt index 973a1fb904..85e04f4c9b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -90,6 +90,7 @@ wxMSW: - Fix hang after clearing wxTAB_TRAVERSAL style on a window with children. - Fix handling of AUX2 mouse button events (Trylz). - Fix saving/restoring window position for maximized windows. +- Fix stack corruption when using wxStackWalker (srfisk). 3.1.1: (released 2018-02-19) diff --git a/src/msw/debughlp.cpp b/src/msw/debughlp.cpp index a04fa47835..7aecd7f032 100644 --- a/src/msw/debughlp.cpp +++ b/src/msw/debughlp.cpp @@ -66,7 +66,7 @@ class VarSizedStruct public: VarSizedStruct() { - ::ZeroMemory(m_buffer, sizeof(T) + MAX_NAME_LEN); + ::ZeroMemory(m_buffer, sizeof(T) + MAX_NAME_LEN*sizeof(TCHAR)); (*this)->SizeOfStruct = sizeof(T); (*this)->MaxNameLen = MAX_NAME_LEN; @@ -87,7 +87,7 @@ private: // if we wanted. enum { MAX_NAME_LEN = 1024 }; - BYTE m_buffer[sizeof(T) + MAX_NAME_LEN]; + BYTE m_buffer[sizeof(T) + MAX_NAME_LEN*sizeof(TCHAR)]; }; } // anonymous namespace