mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 09:02:57 +00:00
[WS2_32] Add some parameters check for getsockname. Use value size for size check instead of type in bind. ROSTEST-278
svn path=/trunk/; revision=74650
This commit is contained in:
parent
0e96026122
commit
f732630141
2 changed files with 20 additions and 12 deletions
|
@ -216,6 +216,8 @@ getsockname(IN SOCKET s,
|
|||
{
|
||||
/* Get the Socket Context */
|
||||
if ((Socket = WsSockGetSocket(s)))
|
||||
{
|
||||
if (name && namelen && (*namelen >= sizeof(*name)))
|
||||
{
|
||||
/* Make the call */
|
||||
Status = Socket->Provider->Service.lpWSPGetSockName(s,
|
||||
|
@ -233,6 +235,12 @@ getsockname(IN SOCKET s,
|
|||
if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* name or namelen not valid */
|
||||
ErrorCode = WSAEFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No Socket Context Found */
|
||||
ErrorCode = WSAENOTSOCK;
|
||||
|
|
|
@ -48,7 +48,7 @@ bind(IN SOCKET s,
|
|||
/* Get the Socket Context */
|
||||
if ((Socket = WsSockGetSocket(s)))
|
||||
{
|
||||
if (name && (namelen >= sizeof(struct sockaddr)))
|
||||
if (name && (namelen >= sizeof(*name)))
|
||||
{
|
||||
/* Make the call */
|
||||
Status = Socket->Provider->Service.lpWSPBind(s,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue