From 64c1b0f05ed8bb8f10c4868ec9e6033ff290e102 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 22 Sep 2004 16:23:05 +0000 Subject: [PATCH] fixed a bug in the handling of wCreateDataSize in CDialogTemplate::Save (thanks Sven Ritter) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3658 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/DialogTemplate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/DialogTemplate.cpp b/Source/DialogTemplate.cpp index fcbc920e..106cd39c 100644 --- a/Source/DialogTemplate.cpp +++ b/Source/DialogTemplate.cpp @@ -664,8 +664,9 @@ BYTE* CDialogTemplate::Save(DWORD& dwSize) { // Write creation data variant length array // First write its size - if (m_vItems[i]->wCreateDataSize) m_vItems[i]->wCreateDataSize += sizeof(WORD); - *(WORD*)seeker = m_vItems[i]->wCreateDataSize; + WORD wCreateDataSize = m_vItems[i]->wCreateDataSize; + if (m_vItems[i]->wCreateDataSize) wCreateDataSize += sizeof(WORD); + *(WORD*)seeker = wCreateDataSize; seeker += sizeof(WORD); // If size is nonzero write the data too if (m_vItems[i]->wCreateDataSize) {