From bfc2b56cbf323c03fd15b23950a65b0c8c22c7a2 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 24 Jun 2005 13:12:03 +0000 Subject: [PATCH] limit MultiByteToWideChar to the real size available, not the total git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4135 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/DialogTemplate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/DialogTemplate.cpp b/Source/DialogTemplate.cpp index afb61580..009768a3 100644 --- a/Source/DialogTemplate.cpp +++ b/Source/DialogTemplate.cpp @@ -83,7 +83,7 @@ void ReadVarLenArr(LPBYTE &seeker, char* &readInto, unsigned int uCodePage) { seeker += sizeof(WORD); \ } \ else { \ - int us = MultiByteToWideChar(m_uCodePage, 0, x, -1, (WCHAR*)seeker, dwSize); \ + int us = MultiByteToWideChar(m_uCodePage, 0, x, -1, (WCHAR*)seeker, dwSize - DWORD(seeker - pbDlg)); \ if (!us) { \ throw runtime_error("WriteStringOrId - Unicode conversion failed."); \ } \