From d9bb9370727ff251d21a16f06959959c4f6a89ed Mon Sep 17 00:00:00 2001 From: anders_k Date: Tue, 16 Feb 2016 18:01:53 +0000 Subject: [PATCH] Make sure the filename string is not destroyed before we are done with the .c_str() pointer. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6710 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/build.cpp b/Source/build.cpp index 228a6a31..419a1786 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -2640,10 +2640,10 @@ int CEXEBuild::write_output(void) crc32_t crc=0; { - tstring full_path = get_full_path(build_output_filename); + tstring full_path = get_full_path(build_output_filename), fnamebuf = get_file_name(build_output_filename); notify(MakensisAPI::NOTIFY_OUTPUT, full_path.c_str()); INFO_MSG(_T("\nOutput: \"%") NPRIs _T("\"\n"), full_path.c_str()); - const TCHAR *fname = get_file_name(build_output_filename).c_str(); + const TCHAR *fname = fnamebuf.c_str(); // Warn when special compatibility names are used. See also: http://github.com/wixtoolset/wix4/commit/3f4341b8ac4d13dffb1d6ba773d48ccc0ab07cf8 if (!lstrcmpi(fname, _T("setup.exe"))) {