mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Fixed #4993: Allow uninitialized bio socket in transport_bio_simple_uninit
When the TLS connection is aborted early (certificate issues, ...) the bio simple socket might not have been initialized. Do not access the NULL pointer on cleanup.
This commit is contained in:
@@ -380,7 +380,7 @@ static int transport_bio_simple_uninit(BIO* bio)
|
||||
|
||||
if (BIO_get_shutdown(bio))
|
||||
{
|
||||
if (BIO_get_init(bio))
|
||||
if (BIO_get_init(bio) && ptr)
|
||||
{
|
||||
_shutdown(ptr->socket, SD_BOTH);
|
||||
closesocket(ptr->socket);
|
||||
@@ -388,7 +388,7 @@ static int transport_bio_simple_uninit(BIO* bio)
|
||||
}
|
||||
}
|
||||
|
||||
if (ptr->hEvent)
|
||||
if (ptr && ptr->hEvent)
|
||||
{
|
||||
CloseHandle(ptr->hEvent);
|
||||
ptr->hEvent = NULL;
|
||||
|
||||
Reference in New Issue
Block a user