diff options
author | KWSys Upstream <kwrobot@kitware.com> | 2016-08-24 14:53:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-24 14:55:18 (GMT) |
commit | fcc532470aa56e7a2e345f7f2396774787feb2ce (patch) | |
tree | 75c9a58efb2a43e2be4048c7c40f82708ca98fca | |
parent | 6c0820a8748e24155d3b7ce6991a90f5a396f524 (diff) | |
download | CMake-fcc532470aa56e7a2e345f7f2396774787feb2ce.zip CMake-fcc532470aa56e7a2e345f7f2396774787feb2ce.tar.gz CMake-fcc532470aa56e7a2e345f7f2396774787feb2ce.tar.bz2 |
KWSys 2016-08-24 (8e643b9b)
Code extracted from:
http://public.kitware.com/KWSys.git
at commit 8e643b9b5f24d4cac68d59b1e2be9d161fb75974 (master).
Upstream Shortlog
-----------------
Brad King (1):
8e643b9b SystemTools: Fix crash in GetShortPath
-rw-r--r-- | SystemTools.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/SystemTools.cxx b/SystemTools.cxx index eb2bec6..1a73b16 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -4725,8 +4725,11 @@ bool SystemTools::GetShortPath(const std::string& path, std::string& shortPath) std::wstring wtempPath = Encoding::ToWide(tempPath); DWORD ret = GetShortPathNameW(wtempPath.c_str(), NULL, 0); std::vector<wchar_t> buffer(ret); - ret = GetShortPathNameW(wtempPath.c_str(), - &buffer[0], static_cast<DWORD>(buffer.size())); + if (ret != 0) + { + ret = GetShortPathNameW(wtempPath.c_str(), + &buffer[0], static_cast<DWORD>(buffer.size())); + } if (ret == 0) { |