From 63e81a1a959a62939aaf555cb01f1552be1032fc Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 26 Jun 2024 19:24:41 -0600 Subject: [PATCH] vrclient_x64: Fix source length for ntdll_umbstowcs(). CW-Bug-Id: #23962 --- vrclient_x64/json_converter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vrclient_x64/json_converter.cpp b/vrclient_x64/json_converter.cpp index 7d6b4f66..aa1573b9 100644 --- a/vrclient_x64/json_converter.cpp +++ b/vrclient_x64/json_converter.cpp @@ -72,7 +72,7 @@ char *vrclient_dos_to_unix_path( const char *src ) char *unix_path; uint32_t r; - r = ntdll_umbstowcs( src, -1, srcW + 4, PATH_MAX - 4 ); + r = ntdll_umbstowcs( src, strlen( src ) + 1, srcW + 4, PATH_MAX - 4 ); if (r == 0) unix_path = NULL; else { @@ -182,7 +182,7 @@ static bool convert_path_to_win(std::string &s) char *unix_path; uint32_t sz; - sz = ntdll_umbstowcs( s.c_str(), -1, srcW + 4, PATH_MAX - 4 ); + sz = ntdll_umbstowcs( s.c_str(), strlen( s.c_str() ) + 1, srcW + 4, PATH_MAX - 4 ); if (!sz) return false; for (tmp = srcW; *tmp; ++tmp) if (*tmp == '/') *tmp = '\\';