aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/win/udp.c7
-rw-r--r--src/win/util.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/win/udp.c b/src/win/udp.c
index e0873c2a..f8aa2435 100644
--- a/src/win/udp.c
+++ b/src/win/udp.c
@@ -1149,10 +1149,13 @@ int uv__udp_try_send2(uv_udp_t* handle,
uv_buf_t* bufs[/*count*/],
unsigned int nbufs[/*count*/],
struct sockaddr* addrs[/*count*/]) {
- unsigned int i;
+ int i;
int r;
- for (i = 0; i < count; i++) {
+ if (count > INT_MAX)
+ return UV_EINVAL;
+
+ for (i = 0; i < (int) count; i++) {
r = uv_udp_try_send(handle, bufs[i], nbufs[i], addrs[i]);
if (r < 0)
return i > 0 ? i : r; /* Error if first packet, else send count. */
diff --git a/src/win/util.c b/src/win/util.c
index 8c2681fe..a8c77103 100644
--- a/src/win/util.c
+++ b/src/win/util.c
@@ -513,8 +513,8 @@ int uv_uptime(double* uptime) {
unsigned int uv_available_parallelism(void) {
DWORD_PTR procmask;
DWORD_PTR sysmask;
- int count;
- int i;
+ unsigned count;
+ unsigned i;
/* TODO(bnoordhuis) Use GetLogicalProcessorInformationEx() to support systems
* with > 64 CPUs? See https://github.com/libuv/libuv/pull/3458