VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/Setup.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-07-09 02:20:39 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 23:20:35 +0100
commitf67748ae8e3ebefc1361d6e8a7f8e5020ff68517 (patch)
tree7598dd5467ab2913b4517745188e5b87f1859078 /src/Setup/Setup.c
parentd6817f941a1218aa1564da158f87ac7ec4434396 (diff)
downloadVeraCrypt-f67748ae8e3ebefc1361d6e8a7f8e5020ff68517.tar.gz
VeraCrypt-f67748ae8e3ebefc1361d6e8a7f8e5020ff68517.zip
Static Code Analysis : fix non-absolute DLL/process loads that can be hijacked (Microsoft Security Advisory 2269637).
Diffstat (limited to 'src/Setup/Setup.c')
-rw-r--r--src/Setup/Setup.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index c0fffb77..5decf595 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -2012,7 +2012,14 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpszComm
}
// System Restore
- SystemRestoreDll = LoadLibrary ("srclient.dll");
+ char dllPath[MAX_PATH];
+ if (GetSystemDirectory (dllPath, MAX_PATH))
+ {
+ strcat(dllPath, "\\srclient.dll");
+ }
+ else
+ strcpy(dllPath, "C:\\Windows\\System32\\srclient.dll");
+ SystemRestoreDll = LoadLibrary (dllPath);
if (!bUninstall)
{