summaryrefslogtreecommitdiffstats
path: root/sandbox/src/sandbox_nt_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/src/sandbox_nt_util.cc')
-rw-r--r--sandbox/src/sandbox_nt_util.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sandbox/src/sandbox_nt_util.cc b/sandbox/src/sandbox_nt_util.cc
index 1452c6b..89da4e0 100644
--- a/sandbox/src/sandbox_nt_util.cc
+++ b/sandbox/src/sandbox_nt_util.cc
@@ -508,6 +508,11 @@ bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length,
if (length < sizeof(FILE_RENAME_INFORMATION))
return false;
+ // Make sure file name length doesn't exceed the message length
+ if (length - offsetof(FILE_RENAME_INFORMATION, FileName) <
+ file_info->FileNameLength)
+ return false;
+
// We don't support a root directory.
if (file_info->RootDirectory)
return false;