mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 03:42:58 +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
1 changed files with 19 additions and 11 deletions
|
@ -47,6 +47,8 @@ bind(IN SOCKET s,
|
||||||
{
|
{
|
||||||
/* Get the Socket Context */
|
/* Get the Socket Context */
|
||||||
if ((Socket = WsSockGetSocket(s)))
|
if ((Socket = WsSockGetSocket(s)))
|
||||||
|
{
|
||||||
|
if (name && (namelen >= sizeof(struct sockaddr)))
|
||||||
{
|
{
|
||||||
/* Make the call */
|
/* Make the call */
|
||||||
Status = Socket->Provider->Service.lpWSPBind(s,
|
Status = Socket->Provider->Service.lpWSPBind(s,
|
||||||
|
@ -63,6 +65,12 @@ bind(IN SOCKET s,
|
||||||
if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
|
if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
/* name or namelen not valid */
|
||||||
|
ErrorCode = WSAEFAULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
/* No Socket Context Found */
|
/* No Socket Context Found */
|
||||||
ErrorCode = WSAENOTSOCK;
|
ErrorCode = WSAENOTSOCK;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue