mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 19:26:29 +00:00
[WS2_32]
Don't pass a null ptr at MSAFD to avoid dereference. Fixes crash in ws2_32:sock svn path=/trunk/; revision=74992
This commit is contained in:
parent
fbfe11f633
commit
1bde2edfcb
1 changed files with 48 additions and 40 deletions
|
@ -38,6 +38,8 @@ connect(IN SOCKET s,
|
|||
{
|
||||
/* Get the Socket Context */
|
||||
if ((Socket = WsSockGetSocket(s)))
|
||||
{
|
||||
if (!IsBadReadPtr(name, sizeof(struct sockaddr)))
|
||||
{
|
||||
while (TRUE)
|
||||
{
|
||||
|
@ -89,6 +91,12 @@ connect(IN SOCKET s,
|
|||
if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Invalid user pointer */
|
||||
ErrorCode = WSAEFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No Socket Context Found */
|
||||
ErrorCode = WSAENOTSOCK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue