udp,win: fix UDP compiler warning (#3647)

Previously it would pass a pointer to uninitialized memory to WSASendTo,
which triggered a compiler warning. However, `addrlen` will be 0, so it
seems unlikely to trigger an error or uninitialized memory access.

Refs: https://github.com/libuv/leps/pull/10
Refs: https://github.com/libuv/libuv/pull/1872
Refs: https://github.com/libuv/libuv/pull/2217
This commit is contained in:
Jameson Nash 2022-06-17 16:06:15 -04:00 committed by GitHub
parent 0b1c752b5c
commit e3aaff185f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1146,6 +1146,7 @@ int uv__udp_try_send(uv_udp_t* handle,
err = uv__convert_to_localhost_if_unspecified(addr, &converted);
if (err)
return err;
addr = (const struct sockaddr*) &converted;
}
/* Already sending a message.*/
@ -1169,7 +1170,7 @@ int uv__udp_try_send(uv_udp_t* handle,
nbufs,
&bytes,
0,
(const struct sockaddr*) &converted,
addr,
addrlen,
NULL,
NULL);