[PATCH 0/1] MR7419: wininet: Fix crash when connection is null in NETCON_secure_connect
There will be crashed when connect is null, so we need avoid crash by checking connect value. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7419
From: Wei xie <xiewei(a)linuxdeepin.com> Signed-off-by: Wei xie <xiewei(a)linuxdeepin.com> --- dlls/wininet/netconnection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 06aa5c82f6c..2c4542b9011 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -596,6 +596,9 @@ DWORD NETCON_secure_connect(netconn_t *connection, server_t *server) { DWORD res; + if (!is_valid_netconn(connection)) + return ERROR_INTERNET_CANNOT_CONNECT; + /* can't connect if we are already connected */ if(connection->secure) { ERR("already connected\n"); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7419
What's the reason for this being NULL? Is the connection closed in some callback? I wonder if we should break connection attempt sooner instead. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7419#note_95878
participants (3)
-
Jacek Caban (@jacek) -
Wei xie -
Yongjie Yao (@yaoyongjie)