diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2012-03-03 13:44:42 -0500 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-03-03 13:45:44 -0500 |
commit | 4fc8c042a2f80ce0a1a277a2dcc1240c015ed400 (patch) | |
tree | 54dd76dd9b29a8bba92a483b6bab8d732d643e87 /src | |
parent | e9865a41d669db0f9245d4494e1620e943ecddf8 (diff) | |
download | bitcoin-4fc8c042a2f80ce0a1a277a2dcc1240c015ed400.tar.xz |
Bugfix: Check return value of SHGetSpecialFolderPath in MyGetSpecialFolderPath
Upstream commit: 21ae37d (partial)
Diffstat (limited to 'src')
-rw-r--r-- | src/util.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp index 85ca02f0aa..e2e104cc88 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -643,13 +643,17 @@ string MyGetSpecialFolderPath(int nFolder, bool fCreate) { PSHGETSPECIALFOLDERPATHA pSHGetSpecialFolderPath = (PSHGETSPECIALFOLDERPATHA)GetProcAddress(hShell32, "SHGetSpecialFolderPathA"); + bool fSuccess = false; if (pSHGetSpecialFolderPath) + fSuccess = (*pSHGetSpecialFolderPath)(NULL, pszPath, nFolder, fCreate); FreeModule(hShell32); + if (fSuccess) + return pszPath; } // Backup option - if (pszPath[0] == '\0') + pszPath[0] = '\0'; { if (nFolder == CSIDL_STARTUP) { |