Skip to content

Commit 12249cc

Browse files
santigimenoaduh95
authored andcommitted
deps: libuv: cherry-pick aabb7651de
Original commit message: win: properly initialize OSVERSIONINFOW (#5107) Otherwise calling `RtlGetVersion()` might produce UB. Problem was causing random crashes in the node.js test suite with stack traces like this one: ``` node.exe!__report_gsfailure(unsigned __int64 stack_cookie) Line 220 at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\gs\gs_report.c(220) ... ``` Fixes: libuv/libuv#5106 Refs: libuv/libuv@aabb765 PR-URL: #62561 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
1 parent 1637db0 commit 12249cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

deps/uv/src/win/tcp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ static int minimal_windows10_version1709(void) {
5656
OSVERSIONINFOW os_info;
5757
if (!pRtlGetVersion)
5858
return 0;
59+
os_info.dwOSVersionInfoSize = sizeof(os_info);
60+
os_info.szCSDVersion[0] = L'\0';
5961
pRtlGetVersion(&os_info);
6062
if (os_info.dwMajorVersion < 10)
6163
return 0;

0 commit comments

Comments
 (0)