Jacek Caban : mscoree: Use wcstok_s instead of wcstok.
Alexandre Julliard
julliard at winehq.org
Fri Mar 20 17:08:21 CDT 2020
Module: wine
Branch: master
Commit: 8f155eea7b3b7a8f480a0ae598b9ca45c30983b3
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8f155eea7b3b7a8f480a0ae598b9ca45c30983b3
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Mar 20 14:36:08 2020 +0100
mscoree: Use wcstok_s instead of wcstok.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mscoree/corruntimehost.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/mscoree/corruntimehost.c b/dlls/mscoree/corruntimehost.c
index a8fc2674ac..7eb4385494 100644
--- a/dlls/mscoree/corruntimehost.c
+++ b/dlls/mscoree/corruntimehost.c
@@ -1425,19 +1425,20 @@ __int32 WINAPI _CorExeMain(void)
hr = parse_config_file(config_file, &parsed_config);
if (SUCCEEDED(hr) && parsed_config.private_path && parsed_config.private_path[0])
{
+ WCHAR *save;
for(i = 0; parsed_config.private_path[i] != 0; i++)
if (parsed_config.private_path[i] == ';') number_of_private_paths++;
if (parsed_config.private_path[wcslen(parsed_config.private_path) - 1] != ';') number_of_private_paths++;
config_file_dir_size = (wcsrchr(config_file, '\\') - config_file) + 1;
priv_path = HeapAlloc(GetProcessHeap(), 0, (number_of_private_paths + 1) * sizeof(WCHAR *));
/* wcstok ignores trailing semicolons */
- temp = wcstok(parsed_config.private_path, scW);
+ temp = wcstok_s(parsed_config.private_path, scW, &save);
for (i = 0; i < number_of_private_paths; i++)
{
priv_path[i] = HeapAlloc(GetProcessHeap(), 0, (config_file_dir_size + wcslen(temp) + 1) * sizeof(WCHAR));
memcpy(priv_path[i], config_file, config_file_dir_size * sizeof(WCHAR));
wcscpy(priv_path[i] + config_file_dir_size, temp);
- temp = wcstok(NULL, scW);
+ temp = wcstok_s(NULL, scW, &save);
}
priv_path[number_of_private_paths] = NULL;
if (InterlockedCompareExchangePointer((void **)&private_path, priv_path, NULL))
More information about the wine-cvs
mailing list