• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Installation Manager Tool


コミットメタ情報

リビジョン0de8716f2eb9838906fb8aaf7bfd2471a11882a2 (tree)
日時2013-07-13 00:27:32
作者Keith Marshall <keithmarshall@user...>
コミッターKeith Marshall

ログメッセージ

Correct a static string buffer aliasing issue.

変更サマリ

差分

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
11 2013-07-12 Keith Marshall <keithmarshall@users.sourceforge.net>
22
3+ Correct a static string buffer aliasing issue.
4+
5+ * src/setup.cpp (SetupTool::setup_dll): New inline method; it ensures
6+ that the buffer within approot_path() refers to the setup helper DLL.
7+ (SetupTool::InitialiseSetupHookAPI): Use it, when loading the DLL.
8+ (SetupTool::SetupTool): Use it again, when subsequently calling...
9+ (_wunlink): ...this; it is now the preferred API, replacing...
10+ (DeleteFileW): ...this; do not blindly assume that...
11+ (SetupTool::dll_name): ...this remains unchanged between references;
12+ it is an alias for the static buffer within approot_path().
13+
14+2013-07-12 Keith Marshall <keithmarshall@users.sourceforge.net>
15+
316 Add a custom profile for use by the setup tool.
417
518 * xml/setup.xml: New file.
--- a/src/setup.cpp
+++ b/src/setup.cpp
@@ -190,6 +190,13 @@ class SetupTool
190190 static const wchar_t *gui_program;
191191 int RunInstalledProgram( const wchar_t * );
192192
193+ inline wchar_t *setup_dll( void )
194+ { /* Helper function to ensure that the static "approot_path" buffer
195+ * specifies a reference path name for mingw-get-setup-0.dll
196+ */
197+ return approot_path( L"libexec\\mingw-get\\mingw-get-setup-0.dll" );
198+ }
199+
193200 inline void CreateApplicationLauncher
194201 ( int, const wchar_t *, const char *, const char * );
195202 };
@@ -449,8 +456,7 @@ bool SetupTool::InitialiseSetupHookAPI( void )
449456 /* Having successfully loaded the main DLL, we perform a similar
450457 * check for the setup tool's bridging DLL...
451458 */
452- dll_name = approot_path( L"libexec\\mingw-get\\mingw-get-setup-0.dll" );
453- if( (hook_dll = LoadLibraryW( dll_name )) == NULL )
459+ if( (hook_dll = LoadLibraryW( dll_name = setup_dll() )) == NULL )
454460 {
455461 /* ...once again, abandoning the installation, if this is not
456462 * available; in this case, since we've already successfully
@@ -1050,7 +1056,7 @@ base_dll( NULL ), hook_dll( NULL )
10501056 * then we must now unload them; we also have no further use for
10511057 * mingw-get-setup-0.dll, so we may delete it.
10521058 */
1053- if( hook_dll != NULL ){ FreeLibrary( hook_dll ); DeleteFileW( dll_name ); }
1059+ if( hook_dll != NULL ){ FreeLibrary( hook_dll ); _wunlink( setup_dll() ); }
10541060 if( base_dll != NULL ){ FreeLibrary( base_dll ); }
10551061
10561062 /* We're done with the COM subsystem; release it.