VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/SetupDLL/Dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/SetupDLL/Dir.c')
-rw-r--r--src/SetupDLL/Dir.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/SetupDLL/Dir.c b/src/SetupDLL/Dir.c
index 2d4feecd..3275567f 100644
--- a/src/SetupDLL/Dir.c
+++ b/src/SetupDLL/Dir.c
@@ -33,2 +33,8 @@ mkfulldir (wchar_t *oriPath, BOOL bCheckonly)
+ if (wcslen(oriPath) >= TC_MAX_PATH)
+ {
+ // directory name will be truncated so return failure to avoid unexepected behavior
+ return -1;
+ }
+
StringCbCopyW (path, TC_MAX_PATH, oriPath);
@@ -68,2 +74,8 @@ mkfulldir_internal (wchar_t *path)
+ if (wcslen(path) >= _MAX_PATH)
+ {
+ // directory name will be truncated so return failure to avoid unexepected behavior
+ return -1;
+ }
+
StringCbCopyW (tokpath, _MAX_PATH, path);