partial fix for bug #1470826 - unaligned memory access
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4713 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
aa9edc8427
commit
e530408b95
1 changed files with 4 additions and 2 deletions
|
@ -464,7 +464,8 @@ int CEXEBuild::preprocess_string(char *out, const char *in, WORD codepage/*=CP_A
|
||||||
// So the line below must be commented !??
|
// So the line below must be commented !??
|
||||||
//m_UserVarNames.inc_reference(idxUserVar);
|
//m_UserVarNames.inc_reference(idxUserVar);
|
||||||
*out++ = (unsigned int) NS_VAR_CODE; // Named user variable;
|
*out++ = (unsigned int) NS_VAR_CODE; // Named user variable;
|
||||||
*(WORD*)out = FIX_ENDIAN_INT16(CODE_SHORT(idxUserVar));
|
WORD w = FIX_ENDIAN_INT16(CODE_SHORT(idxUserVar));
|
||||||
|
memcpy(out, &w, sizeof(WORD));
|
||||||
out += sizeof(WORD);
|
out += sizeof(WORD);
|
||||||
p += pUserVarName-p;
|
p += pUserVarName-p;
|
||||||
bProceced = true;
|
bProceced = true;
|
||||||
|
@ -508,7 +509,8 @@ int CEXEBuild::preprocess_string(char *out, const char *in, WORD codepage/*=CP_A
|
||||||
if (idx < 0)
|
if (idx < 0)
|
||||||
{
|
{
|
||||||
*out++ = (unsigned int)NS_LANG_CODE; // Next word is lang-string Identifier
|
*out++ = (unsigned int)NS_LANG_CODE; // Next word is lang-string Identifier
|
||||||
*(WORD*)out = FIX_ENDIAN_INT16(CODE_SHORT(-idx-1));
|
WORD w = FIX_ENDIAN_INT16(CODE_SHORT(-idx-1));
|
||||||
|
memcpy(out, &w, sizeof(WORD));
|
||||||
out += sizeof(WORD);
|
out += sizeof(WORD);
|
||||||
p += strlen(cp) + 2;
|
p += strlen(cp) + 2;
|
||||||
bProceced = true;
|
bProceced = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue