Fix some possible out of bounds access

* Reported by Coverity Scan
This commit is contained in:
baldurk
2017-11-22 12:22:09 +00:00
parent 9e5cfa8b96
commit 9fe7acb20f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ bool ProcessImplicitLayersKey(HKEY key, const std::wstring &path,
{
bool thisRegistered = false;
wchar_t name[1024] = {};
wchar_t name[1025] = {};
DWORD nameSize = 1024;
DWORD idx = 0;
+1 -1
View File
@@ -540,7 +540,7 @@ uint32_t Process::InjectIntoProcess(uint32_t pid, const rdcarray<EnvironmentModi
wchar_t renderdocPathLower[MAX_PATH] = {0};
memcpy(renderdocPathLower, renderdocPath, MAX_PATH * sizeof(wchar_t));
for(size_t i = 0; renderdocPathLower[i] && i < MAX_PATH; i++)
for(size_t i = 0; i < MAX_PATH && renderdocPathLower[i]; i++)
{
// lowercase
if(renderdocPathLower[i] >= 'A' && renderdocPathLower[i] <= 'Z')