diff --git a/renderdoc/os/win32/win32_process.cpp b/renderdoc/os/win32/win32_process.cpp index d3095c4b3..331669954 100644 --- a/renderdoc/os/win32/win32_process.cpp +++ b/renderdoc/os/win32/win32_process.cpp @@ -391,7 +391,7 @@ uint32_t Process::CreateAndInjectIntoProcess(const char *app, const char *workin paramsAlloc = new wchar_t[len]; - RDCEraseMem(paramsAlloc, len); + RDCEraseMem(paramsAlloc, len*sizeof(wchar_t)); wcscpy_s(paramsAlloc, len, L"\""); wcscat_s(paramsAlloc, len, wapp.c_str()); diff --git a/renderdoc/serialise/string_utils.h b/renderdoc/serialise/string_utils.h index c16ad6b26..58d15646c 100644 --- a/renderdoc/serialise/string_utils.h +++ b/renderdoc/serialise/string_utils.h @@ -45,7 +45,7 @@ template strType basename(const strType &path) if(base[base.length()-1] == '/' || base[base.length()-1] == '\\') base.erase(base.size()-1); - typename strType::value_type pathSep[2] = { '\\', '/' }; + typename strType::value_type pathSep[3] = { '\\', '/', 0 }; size_t offset = base.find_last_of(pathSep); @@ -65,7 +65,7 @@ template strType dirname(const strType &path) if(base[base.length()-1] == '/' || base[base.length()-1] == '\\') base.erase(base.size()-1); - typename strType::value_type pathSep[2] = { '\\', '/' }; + typename strType::value_type pathSep[3] = { '\\', '/', 0 }; size_t offset = base.find_last_of(pathSep);