Commit ffff393e authored by Rafaël Carré's avatar Rafaël Carré

UAC: offsetof only needs to know the field name

Don't specify the (variable) size
parent 941cff44
...@@ -360,7 +360,7 @@ DWORD SyncVars(HWND hwndNSIS) ...@@ -360,7 +360,7 @@ DWORD SyncVars(HWND hwndNSIS)
if (!g.UseIPC)return NO_ERROR; if (!g.UseIPC)return NO_ERROR;
g.NSISStrLen=NSIS::StrSize; g.NSISStrLen=NSIS::StrSize;
TRACEF("SyncVars: g.NSISStrLen=%d\n",g.NSISStrLen);ASSERT(g.NSISStrLen>10); TRACEF("SyncVars: g.NSISStrLen=%d\n",g.NSISStrLen);ASSERT(g.NSISStrLen>10);
DWORD cbStruct=FIELD_OFFSET(IPC_SYNCVAR,buf[g.NSISStrLen+1]); DWORD cbStruct=FIELD_OFFSET(IPC_SYNCVAR,buf);
pSV=(IPC_SYNCVAR*)MemAlloc(cbStruct); pSV=(IPC_SYNCVAR*)MemAlloc(cbStruct);
if (!pSV) if (!pSV)
goto die_GLE; goto die_GLE;
...@@ -503,7 +503,7 @@ void HandleExecExport(bool CreateProc,bool Wait,HWND&hwndNSIS,int&StrSize,NSISCH ...@@ -503,7 +503,7 @@ void HandleExecExport(bool CreateProc,bool Wait,HWND&hwndNSIS,int&StrSize,NSISCH
cch+=lstrlen(pSIParams->text)+1; cch+=lstrlen(pSIParams->text)+1;
cch+=lstrlen(pSIWorkDir->text)+1; cch+=lstrlen(pSIWorkDir->text)+1;
if (pSIVerb)cch+=lstrlen(pSIVerb->text)+1; if (pSIVerb)cch+=lstrlen(pSIVerb->text)+1;
cbStruct=FIELD_OFFSET( IPC_SHEXEC, buf[cch*sizeof(TCHAR)] ); cbStruct=FIELD_OFFSET( IPC_SHEXEC, buf );
pISE=(IPC_SHEXEC*)NSIS::MemAlloc(cbStruct); pISE=(IPC_SHEXEC*)NSIS::MemAlloc(cbStruct);
if (!pISE)ec=GetLastError(); if (!pISE)ec=GetLastError();
if (!ec) if (!ec)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment