Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7f5583ae
Commit
7f5583ae
authored
Dec 02, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Dec 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Set length on successful return from WSAStringToAddress.
parent
d4d7c263
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
socket.c
dlls/ws2_32/socket.c
+2
-0
sock.c
dlls/ws2_32/tests/sock.c
+16
-1
No files found.
dlls/ws2_32/socket.c
View file @
7f5583ae
...
@@ -5953,6 +5953,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString,
...
@@ -5953,6 +5953,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString,
res
=
WSAEFAULT
;
res
=
WSAEFAULT
;
break
;
break
;
}
}
*
lpAddressLength
=
sizeof
(
SOCKADDR_IN
);
memset
(
lpAddress
,
0
,
sizeof
(
SOCKADDR_IN
));
memset
(
lpAddress
,
0
,
sizeof
(
SOCKADDR_IN
));
((
LPSOCKADDR_IN
)
lpAddress
)
->
sin_family
=
AF_INET
;
((
LPSOCKADDR_IN
)
lpAddress
)
->
sin_family
=
AF_INET
;
...
@@ -5990,6 +5991,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString,
...
@@ -5990,6 +5991,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString,
break
;
break
;
}
}
#ifdef HAVE_INET_PTON
#ifdef HAVE_INET_PTON
*
lpAddressLength
=
sizeof
(
SOCKADDR_IN6
);
memset
(
lpAddress
,
0
,
sizeof
(
SOCKADDR_IN6
));
memset
(
lpAddress
,
0
,
sizeof
(
SOCKADDR_IN6
));
((
LPSOCKADDR_IN6
)
lpAddress
)
->
sin6_family
=
WS_AF_INET6
;
((
LPSOCKADDR_IN6
)
lpAddress
)
->
sin6_family
=
WS_AF_INET6
;
...
...
dlls/ws2_32/tests/sock.c
View file @
7f5583ae
...
@@ -1801,8 +1801,9 @@ static void test_WSAStringToAddressA(void)
...
@@ -1801,8 +1801,9 @@ static void test_WSAStringToAddressA(void)
static
void
test_WSAStringToAddressW
(
void
)
static
void
test_WSAStringToAddressW
(
void
)
{
{
INT
ret
,
len
;
INT
ret
,
len
;
SOCKADDR_IN
sockaddr
;
SOCKADDR_IN
sockaddr
,
*
sin
;
SOCKADDR_IN6
sockaddr6
;
SOCKADDR_IN6
sockaddr6
;
SOCKADDR_STORAGE
sockaddr_storage
;
int
GLE
;
int
GLE
;
WCHAR
address1
[]
=
{
'0'
,
'.'
,
'0'
,
'.'
,
'0'
,
'.'
,
'0'
,
0
};
WCHAR
address1
[]
=
{
'0'
,
'.'
,
'0'
,
'.'
,
'0'
,
'.'
,
'0'
,
0
};
...
@@ -1866,6 +1867,20 @@ static void test_WSAStringToAddressW(void)
...
@@ -1866,6 +1867,20 @@ static void test_WSAStringToAddressW(void)
(
ret
==
SOCKET_ERROR
&&
(
GLE
==
ERROR_INVALID_PARAMETER
||
GLE
==
WSAEINVAL
)),
(
ret
==
SOCKET_ERROR
&&
(
GLE
==
ERROR_INVALID_PARAMETER
||
GLE
==
WSAEINVAL
)),
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
GLE
);
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
GLE
);
/* Test with a larger buffer than necessary */
len
=
sizeof
(
sockaddr_storage
);
sin
=
(
SOCKADDR_IN
*
)
&
sockaddr_storage
;
sin
->
sin_port
=
0
;
sin
->
sin_addr
.
s_addr
=
0
;
ret
=
WSAStringToAddressW
(
address5
,
AF_INET
,
NULL
,
(
SOCKADDR
*
)
sin
,
&
len
);
ok
(
(
ret
==
0
&&
sin
->
sin_addr
.
s_addr
==
0xffffffff
&&
sin
->
sin_port
==
0xffff
)
||
(
ret
==
SOCKET_ERROR
&&
(
GLE
==
ERROR_INVALID_PARAMETER
||
GLE
==
WSAEINVAL
)),
"WSAStringToAddressW() failed unexpectedly: %d
\n
"
,
GLE
);
ok
(
len
==
sizeof
(
SOCKADDR_IN
)
||
broken
(
len
==
sizeof
(
SOCKADDR_STORAGE
))
/* NT4/2k */
,
"unexpected length %d
\n
"
,
len
);
len
=
sizeof
(
sockaddr6
);
len
=
sizeof
(
sockaddr6
);
memset
(
&
sockaddr6
,
0
,
len
);
memset
(
&
sockaddr6
,
0
,
len
);
sockaddr6
.
sin6_family
=
AF_INET6
;
sockaddr6
.
sin6_family
=
AF_INET6
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment