mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 10:00:56 +00:00
[WS2_32] Perform parameters check on bind. ROSTESTS-278
svn path=/trunk/; revision=74649
This commit is contained in:
parent
7ee1b6a5f5
commit
0e96026122
|
@ -48,19 +48,27 @@ bind(IN SOCKET s,
|
||||||
/* Get the Socket Context */
|
/* Get the Socket Context */
|
||||||
if ((Socket = WsSockGetSocket(s)))
|
if ((Socket = WsSockGetSocket(s)))
|
||||||
{
|
{
|
||||||
/* Make the call */
|
if (name && (namelen >= sizeof(struct sockaddr)))
|
||||||
Status = Socket->Provider->Service.lpWSPBind(s,
|
{
|
||||||
name,
|
/* Make the call */
|
||||||
namelen,
|
Status = Socket->Provider->Service.lpWSPBind(s,
|
||||||
&ErrorCode);
|
name,
|
||||||
/* Deference the Socket Context */
|
namelen,
|
||||||
WsSockDereference(Socket);
|
&ErrorCode);
|
||||||
|
/* Deference the Socket Context */
|
||||||
|
WsSockDereference(Socket);
|
||||||
|
|
||||||
/* Return Provider Value */
|
/* Return Provider Value */
|
||||||
if (Status == ERROR_SUCCESS) return Status;
|
if (Status == ERROR_SUCCESS) return Status;
|
||||||
|
|
||||||
/* If everything seemed fine, then the WSP call failed itself */
|
/* If everything seemed fine, then the WSP call failed itself */
|
||||||
if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
|
if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* name or namelen not valid */
|
||||||
|
ErrorCode = WSAEFAULT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue