[vlc-commits] UAC: offsetof only needs to know the field name

Rafaël Carré git at videolan.org
Mon Nov 18 13:40:50 CET 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Nov 18 13:39:27 2013 +0100| [ffff393ec1421aa7ff00cb5fb024d6fbee931fd4] | committer: Rafaël Carré

UAC: offsetof only needs to know the field name

Don't specify the (variable) size

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ffff393ec1421aa7ff00cb5fb024d6fbee931fd4
---

 extras/package/win32/NSIS/UAC/uac.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/extras/package/win32/NSIS/UAC/uac.cpp b/extras/package/win32/NSIS/UAC/uac.cpp
index b35c47a..5f25f4f 100644
--- a/extras/package/win32/NSIS/UAC/uac.cpp
+++ b/extras/package/win32/NSIS/UAC/uac.cpp
@@ -360,7 +360,7 @@ DWORD SyncVars(HWND hwndNSIS)
 	if (!g.UseIPC)return NO_ERROR;
 	g.NSISStrLen=NSIS::StrSize;
 	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);
 	if (!pSV)
 		goto die_GLE;
@@ -503,7 +503,7 @@ void HandleExecExport(bool CreateProc,bool Wait,HWND&hwndNSIS,int&StrSize,NSISCH
 	cch+=lstrlen(pSIParams->text)+1;
 	cch+=lstrlen(pSIWorkDir->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);
 	if (!pISE)ec=GetLastError();
 	if (!ec) 



More information about the vlc-commits mailing list