Skip to content

Commit 86f2cd5

Browse files
committed
patch 7.4.2145
Problem: Win32: Using CreateThread/ExitThread is not safe. Solution: Use _beginthreadex and return from the thread. (Ken Takata)
1 parent 796aa9c commit 86f2cd5

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/os_win32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4267,7 +4267,7 @@ sub_process_writer(LPVOID param)
42674267

42684268
/* finished all the lines, close pipe */
42694269
CloseHandle(g_hChildStd_IN_Wr);
4270-
ExitThread(0);
4270+
return 0;
42714271
}
42724272

42734273

@@ -4491,8 +4491,8 @@ mch_system_piped(char *cmd, int options)
44914491

44924492
if (options & SHELL_WRITE)
44934493
{
4494-
HANDLE thread =
4495-
CreateThread(NULL, /* security attributes */
4494+
HANDLE thread = (HANDLE)
4495+
_beginthreadex(NULL, /* security attributes */
44964496
0, /* default stack size */
44974497
sub_process_writer, /* function to be executed */
44984498
g_hChildStd_IN_Wr, /* parameter */

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2145,
766768
/**/
767769
2144,
768770
/**/

0 commit comments

Comments
 (0)