History log of /libuv/src/win/getaddrinfo.c (Results 1 – 25 of 40)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 52a92433 17-Oct-2024 Thad House

win: Fix linked list logic in getaddrinfo (#4578)

The logic in #4254 is incorrect, and results in the addrinfo linked
list only having a single result. Fix this by correcting the logic.

win: Fix linked list logic in getaddrinfo (#4578)

The logic in #4254 is incorrect, and results in the addrinfo linked
list only having a single result. Fix this by correcting the logic.

Closes #4577

show more ...


# 9b3b61f6 05-Aug-2024 Matheus Izvekov

build: ubsan fixes (#4254)

MSVC does not actually support ubsan. There is a long-standing ticket
requesting this:
https://developercommunity.visualstudio.com/t/add-support-for-ubsan/

build: ubsan fixes (#4254)

MSVC does not actually support ubsan. There is a long-standing ticket
requesting this:
https://developercommunity.visualstudio.com/t/add-support-for-ubsan/840750

There are no known compilers that currently accept the
`/fsanitize=undefined` spelling. clang-cl accepts `-fsanitize...`,
same as regular clang.

Also passes no-sanitizer-recover so that tests actually fail.

Fix various ubsan-detected errors, including:

* win: fix req-inl.h ubsan failure

Don't use CONTAINING_RECORD macro from WinSDK, as it doesn't use the
right trick which avoids member access on null pointer.

Fixes:
```
src/win/req-inl.h:86:10: runtime error: member access within null pointer of type 'uv_req_t' (aka 'struct uv_req_s')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior D:/a/libuv/libuv/src/win/req-inl.h:86:10
```

* test: fix ubsan failure on udp_ref3

Don't call functions through different function type.

Fixes:
```
src/win/udp.c:537:5: runtime error: call to function req_cb through pointer to incorrect function type 'void (*)(struct uv_udp_send_s *, int)'
test\test-ref.c:66: note: req_cb defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/udp.c:537:5 in
```

* win: fix process-stdio.c ubsan failure

When accessing HANDLEs within the stdio buffer, use memcpy / memset in order to respect alignment.

Fixes:
```
src/win/process-stdio.c:197:5: runtime error: store to misaligned address 0x0230ee72d107 for type 'HANDLE' (aka 'void *'), which requires 8 byte alignment
0x0230ee72d107: note: pointer points here
00 00 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd fd fd fd fd
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/process-stdio.c:197:5 in
```

* win: fix getaddrinfo.c ubsan failure

Reworks buffer alignment handling to respect requirements.

Fixes:
```
src/win/getaddrinfo.c:157:23: runtime error: member access within misaligned address 0x0290e4c6a17c for type 'struct addrinfo', which requires 8 byte alignment
0x0290e4c6a17c: note: pointer points here
00 00 00 00 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/getaddrinfo.c:157:23 in
```

* win: fix pipe.c ubsan failure

Changes "random" representation from pointer to number.

Fixes:
```
src/win/pipe.c:234:11: runtime error: applying non-zero offset to non-null pointer 0xffffffffffffffff produced null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/win/pipe.c:234:11 in
```

* unix: fix stream.c ubsan failure

Avoids performing pointer arithmetic on null pointer.

Fixes:
```
src/unix/stream.c:701:15: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/libuv/libuv/src/unix/stream.c:701:15 in
```

show more ...


# 7c491bde 11-Jul-2024 Viacheslav Muravyev

unix,win: remove unused req parameter from macros (#4435)

Remove the unused `req` parameter from the uv__req_register and
uv__req_unregister macros.


# f3889085 29-Oct-2023 Jameson Nash

misc: export WTF8 conversion utilities (#4021)

As promised in #2970, this attempts to migrate code to a common set of
utilities in a common place in the code and use them everywhere. Thi

misc: export WTF8 conversion utilities (#4021)

As promised in #2970, this attempts to migrate code to a common set of
utilities in a common place in the code and use them everywhere. This
also exports the functionality, since the Windows API with
WideCharToMultiByte is fairly verbose relative to what libuv and
libuv's clients typically need, so it is useful not to require clients
to reimplement this conversion logic unnecessarily (and because Windows
is not 64-bit ready here, but this implementation is.)

show more ...


Revision tags: v1.41.0, v1.40.0, v1.39.0, v1.38.1, v1.38.0, v1.37.0, v1.36.0, v1.35.0, v1.34.2, v1.34.1, v1.34.0, v1.33.1, v1.33.0, v1.32.0, v1.31.0, v1.30.1, v1.30.0, v1.29.1, v1.29.0, v1.28.0, v1.27.0, v1.26.0, v1.25.0, v1.24.1, v1.24.0
# 6dd44caa 19-Oct-2018 Ben Noordhuis

unix,win: support IDNA 2008 in uv_getaddrinfo()

Encode domain names before passing them on to the libc resolver.
Some getaddrinfo() implementations support IDNA 2008, some only
IDNA

unix,win: support IDNA 2008 in uv_getaddrinfo()

Encode domain names before passing them on to the libc resolver.
Some getaddrinfo() implementations support IDNA 2008, some only
IDNA 2003 and some don't support i18n domain names at all.

This is a potential security issue because it means a domain name
might resolve differently depending on the system that libuv is
running on.

Fixes: https://github.com/libuv/libuv/issues/2028
PR-URL: https://github.com/libuv/libuv/pull/2046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>

show more ...

Revision tags: v1.23.2, v1.23.1, v1.23.0, v1.22.0, v1.21.0
# 90891b42 25-May-2018 Anna Henningsen

unix,win: limit concurrent DNS calls to nthreads/2

If `nthreads / 2` (rounded up) DNS calls are outstanding,
queue more work of that kind instead of letting it take over
more positio

unix,win: limit concurrent DNS calls to nthreads/2

If `nthreads / 2` (rounded up) DNS calls are outstanding,
queue more work of that kind instead of letting it take over
more positions in the thread pool, blocking other work
such as the (usually much faster) file system I/O or
user-scheduled work.

Fixes: https://github.com/nodejs/node/issues/8436
PR-URL: https://github.com/libuv/libuv/pull/1845
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>

show more ...

# e318e001 29-May-2018 Bert Belder

Revert "win: add Windows XP support to uv_if_indextoname()"

Libuv is not supported on Windows XP, as stated in the
SUPPORTED_PLATFORMS document. It also can't possibly work because
`

Revert "win: add Windows XP support to uv_if_indextoname()"

Libuv is not supported on Windows XP, as stated in the
SUPPORTED_PLATFORMS document. It also can't possibly work because
`ReOpenFile()` in src/win/fs.c is not weakly linked, so any executable
that links libuv would simply fail to load on XP.

This reverts commit 17eaa956bde35daad99b36b820daf8e8227add74.

Refs: https://github.com/libuv/libuv/pull/1810
PR-URL: https://github.com/libuv/libuv/pull/1854
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

# 9584df25 29-May-2018 Bert Belder

src,test: fix idiosyncratic comment style

Back in the day I wrote comments in a really unusual way. Nowadays it
makes my eyes bleed, and clang-format doesn't know how to deal with it.

src,test: fix idiosyncratic comment style

Back in the day I wrote comments in a really unusual way. Nowadays it
makes my eyes bleed, and clang-format doesn't know how to deal with it.

PR-URL: https://github.com/libuv/libuv/pull/1853
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

show more ...

Revision tags: v1.20.3, v1.20.2
# 17eaa956 20-Apr-2018 ssrlive <30760636+ssrlive@users.noreply.github.com>

win: add Windows XP support to uv_if_indextoname()

This commit attempts to dynamically load
ConvertInterfaceIndexToLuid() and ConvertInterfaceLuidToNameW()
from iphlpapi.dll before u

win: add Windows XP support to uv_if_indextoname()

This commit attempts to dynamically load
ConvertInterfaceIndexToLuid() and ConvertInterfaceLuidToNameW()
from iphlpapi.dll before using them. If they are not available,
UV_ENOSYS is returned.

PR-URL: https://github.com/libuv/libuv/pull/1810
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

Revision tags: v1.20.1, v1.20.0, v1.19.2, v1.19.1, v1.19.0, v1.18.0, v1.17.0, v1.16.1
# 84fa7fc7 09-Nov-2017 Nick Logan

win: fix undeclared NDIS_IF_MAX_STRING_SIZE

NDIS_IF_MAX_STRING_SIZE does not appear to be available on
some Windows systems. This commit defines it using the same logic
used by Wires

win: fix undeclared NDIS_IF_MAX_STRING_SIZE

NDIS_IF_MAX_STRING_SIZE does not appear to be available on
some Windows systems. This commit defines it using the same logic
used by Wireshark.

See: https://github.com/boundary/wireshark/blob/07eade8124fd1d5386161591b52e177ee6ea849f/capture_win_ifnames.c#L42-L44
Refs: https://github.com/nodejs/node/pull/16835
Refs: https://github.com/libuv/libuv/pull/1445
PR-URL: https://github.com/libuv/libuv/pull/1623
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>

show more ...

Revision tags: v1.16.0, v1.15.0, v1.14.1, v1.14.0
# 695afe83 27-Jul-2017 Pekka Nikander

unix,win: add uv_if_{indextoname,indextoiid}

uv_if_indextoname() is used to convert an IPv6 scope_id
to an interface identifier string such as %eth0 or %lo.

uv_if_indextoiid() r

unix,win: add uv_if_{indextoname,indextoiid}

uv_if_indextoname() is used to convert an IPv6 scope_id
to an interface identifier string such as %eth0 or %lo.

uv_if_indextoiid() returns an IPv6 interface identifier.
On Unix it calls uv_if_indextoname(). On Windows it uses
snprintf() to return the numeric interface identifier as
a string.

Refs: https://github.com/nodejs/node/pull/14500
PR-URL: https://github.com/libuv/libuv/pull/1445
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

Revision tags: v1.13.1, v1.13.0, v1.12.0, v1.11.0, v1.10.2, v1.10.1, v1.10.0
# 87df1448 14-Oct-2016 Ben Noordhuis

unix,windows: refactor request init logic

Fixes a TODO in src/threadpool.c. Updates the Windows code to drop the
unused `loop` parameter in calls to uv_req_init().

PR-URL: http

unix,windows: refactor request init logic

Fixes a TODO in src/threadpool.c. Updates the Windows code to drop the
unused `loop` parameter in calls to uv_req_init().

PR-URL: https://github.com/libuv/libuv/pull/1091
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

# 7bfb5ae7 03-Nov-2016 Ben Noordhuis

win: fix free() on bad input in uv_getaddrinfo()

The error path frees `req->alloc` but that hasn't been set yet when
`service` and `node` are both NULL. Simply return instead of jumping

win: fix free() on bad input in uv_getaddrinfo()

The error path frees `req->alloc` but that hasn't been set yet when
`service` and `node` are both NULL. Simply return instead of jumping
to the error handling block.

Fixes: https://github.com/libuv/libuv/issues/1122
PR-URL: https://github.com/libuv/libuv/pull/1123
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v0.10.37, v1.9.1, v1.9.0
# f04d5fc3 14-Mar-2016 cjihrig

win: use native APIs for UTF conversions

This commit replaces uv_utf16_to_utf8() and uv_utf8_to_utf16()
with calls to the native Windows API equivalents.

Refs: https://github.co

win: use native APIs for UTF conversions

This commit replaces uv_utf16_to_utf8() and uv_utf8_to_utf16()
with calls to the native Windows API equivalents.

Refs: https://github.com/libuv/libuv/pull/672#discussion_r49049746
PR-URL: https://github.com/libuv/libuv/pull/762
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.8.0
# 81072b98 02-Nov-2015 Ian Kronquist

misc: remove unnecessary null pointer checks

Fixes: https://github.com/libuv/libuv/issues/595
PR-URL: https://github.com/libuv/libuv/pull/604
Reviewed-By: Saúl Ibarra Corretgé <saghu

misc: remove unnecessary null pointer checks

Fixes: https://github.com/libuv/libuv/issues/595
PR-URL: https://github.com/libuv/libuv/pull/604
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.7.5, v1.7.4, v1.7.3, v1.7.2, v1.7.1, v1.7.0, v1.6.1, v1.6.0
# bddd6a84 26-May-2015 Saúl Ibarra Corretgé

core: add ability to customize memory allocator

This patch is composed by the work done in
https://github.com/libuv/libuv/pull/231 and
https://github.com/libuv/libuv/pull/287 plus so

core: add ability to customize memory allocator

This patch is composed by the work done in
https://github.com/libuv/libuv/pull/231 and
https://github.com/libuv/libuv/pull/287 plus some changes by yours
truly.

Thanks @beevik and @mattsta for their work on this!

PR-URL: https://github.com/libuv/libuv/pull/368
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...

Revision tags: v1.5.0
# 1f711e4d 29-Apr-2015 Saúl Ibarra Corretgé

Revert "memory: add uv_replace_allocator"

This reverts commit c272f1f1bc0bda625e6441d798c110b4064a6ce2.

The concept will come back to libuv, but it needs some more work.

# 43ac8e17 14-Mar-2015 Brett Vickers

win: remove unnecessary malloc.h #includes

Several windows .c files are including malloc.h unnecessarily.
This commit removes #includes that should have been removed
when we switched

win: remove unnecessary malloc.h #includes

Several windows .c files are including malloc.h unnecessarily.
This commit removes #includes that should have been removed
when we switched over to uv__malloc and uv__free (in commit
c272f1f1bc0bda625e6441d798c110b4064a6ce2).

PR-URL: https://github.com/libuv/libuv/pull/270
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...

# c272f1f1 26-Feb-2015 Brett Vickers

memory: add uv_replace_allocator

With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This

memory: add uv_replace_allocator

With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This allows libuv to interoperate with projects requiring a
custom memory allocator.

Internally, all calls to malloc and free have been replaced with
uv__malloc and uv__free, respectively. The uv__malloc and uv__free
functions call malloc and free unless they have been overridden by a
previous call to uv_replace_allocator.

As part of this change, the special aligned memory allocations
performed in src/win/fs-event.c have been replaced with standard
allocations. The 4-byte alignment being requested in this file was
unnecessary, since standard allocators already guarantee at least an
8-byte alignment.

PR-URL: https://github.com/libuv/libuv/pull/231
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v0.10.36, v1.4.2, v0.10.35, v1.4.1, v0.10.34, v1.4.0, v1.3.0, v0.10.33
# ba09b39b 28-Jan-2015 Saúl Ibarra Corretgé

windows: fix regression when cancelling getaddrinfo

The req->addrinfow field contains the hints in that case, so we must not
free it.

This regression was introduced in f2bb8d3 b

windows: fix regression when cancelling getaddrinfo

The req->addrinfow field contains the hints in that case, so we must not
free it.

This regression was introduced in f2bb8d3 by yours truly.

PR-URL: https://github.com/libuv/libuv/pull/171
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...

# f2bb8d39 20-Jan-2015 Saúl Ibarra Corretgé

unix, win: add synchronous uv_get{addr,name}info

PR-URL: https://github.com/libuv/libuv/pull/156
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@

unix, win: add synchronous uv_get{addr,name}info

PR-URL: https://github.com/libuv/libuv/pull/156
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>

show more ...

Revision tags: v1.2.1, v1.2.0, v0.10.32, v1.1.0, v0.10.31, v1.0.2, v0.10.30
# 3aeca36a 28-Nov-2014 Joey Geralnik

unix, windows: fix typos in comments

Fix various typos and spelling mistakes in comments.
Does not affect any code, just changes comments.

PR-URL: https://github.com/libuv/libuv

unix, windows: fix typos in comments

Fix various typos and spelling mistakes in comments.
Does not affect any code, just changes comments.

PR-URL: https://github.com/libuv/libuv/pull/17
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...

Revision tags: v1.0.1, v1.0.0, v0.10.29, v1.0.0-rc2, v1.0.0-rc1
# a87619ce 21-Aug-2014 Saúl Ibarra Corretgé

unix, windows: move includes for EAI constants

Revision tags: v0.11.29
# c87c44ff 08-Aug-2014 Alexis Campailla

windows: fix uv__getaddrinfo_translate_error

Use Windows socket error codes, as recommended by MSDN, like we already
do with GetNameInfoW.

Revision tags: v0.11.28, v0.11.27, v0.10.28, v0.11.26
# 8d11aacb 17-Jun-2014 Saúl Ibarra Corretgé

unix, windows: use the same threadpool implementation

12