From 608505ee78ca33a6390d0d95165baed39848e241 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 31 Oct 2023 10:10:36 -0600 Subject: [PATCH] fixup! vrclient: Allocate memory for every path conversion. --- vrclient_x64/vrclient_x64/vrclient_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vrclient_x64/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_x64/vrclient_main.c index 254cab72..f6414e37 100644 --- a/vrclient_x64/vrclient_x64/vrclient_main.c +++ b/vrclient_x64/vrclient_x64/vrclient_main.c @@ -103,7 +103,7 @@ char *vrclient_dos_to_unix_path( const char *src ) if (!src) return NULL; *dst = 0; - if (*src) goto done; + if (!*src) goto done; if(IS_ABSOLUTE(src)){ /* absolute path, use wine conversion */ @@ -146,7 +146,7 @@ char *vrclient_dos_to_unix_path( const char *src ) done: len = strlen( buffer ); if (!(dst = HeapAlloc( GetProcessHeap(), 0, len + 1 ))) return NULL; - memcpy( dst, buffer, len ); + memcpy( dst, buffer, len + 1 ); return dst; }