[PATCH 0/1] MR2505: iphlpapi: Return FALSE for bad handles in IcmpCloseHandle
Passing `NULL` or `INVALID_HANDLE_VALUE` into `IcmpCloseHandle` currently causes a segfault on wine, whereas it returns `FALSE` on windows. It seems FFXIV occasionally does this. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2505
From: Marc-Aurel Zent <marc_aurel(a)me.com> --- dlls/iphlpapi/iphlpapi_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 6286c168277..d773226da7b 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -4565,6 +4565,9 @@ struct icmp_handle_data */ BOOL WINAPI IcmpCloseHandle( HANDLE handle ) { + if (handle == NULL || handle == INVALID_HANDLE_VALUE) + return FALSE; + struct icmp_handle_data *data = (struct icmp_handle_data *)handle; CloseHandle( data->nsi_device ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2505
participants (2)
-
Marc-Aurel Zent -
Marc-Aurel Zent (@marzent)