From fced277adf17faf73178be84dbf32f80ad3e30aa Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 26 Jun 2024 19:19:11 -0600 Subject: [PATCH] lsteamclient: Fix source length for ntdll_umbstowcs(). CW-Bug-Id: #23962 --- lsteamclient/unixlib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lsteamclient/unixlib.cpp b/lsteamclient/unixlib.cpp index 1ca02ced..8d4fdbea 100644 --- a/lsteamclient/unixlib.cpp +++ b/lsteamclient/unixlib.cpp @@ -561,7 +561,7 @@ char *steamclient_dos_to_unix_path( const char *src, int is_url ) uint32_t r; if (is_url) while (*src == '/') ++src; - 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 { @@ -628,7 +628,7 @@ const char **steamclient_dos_to_unix_path_array( const char **src ) TRACE( " src[%zu] %s\n", s - src, debugstr_a(*s) ); if (IS_ABSOLUTE( *s )) { - ntdll_umbstowcs( *s, -1, scratch + 4, PATH_MAX - 4 ); + ntdll_umbstowcs( *s, strlen( *s ) + 1, scratch + 4, PATH_MAX - 4 ); collapse_path( scratch, 4 ); *o = get_unix_file_name( scratch ); }