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
f21b25ae
Commit
f21b25ae
authored
May 18, 2020
by
Alex Henrie
Committed by
Alexandre Julliard
May 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Set WSAEINVAL in InetPtonW if the address string is unparsable.
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4cb95848
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
socket.c
dlls/ws2_32/socket.c
+1
-0
sock.c
dlls/ws2_32/tests/sock.c
+9
-6
No files found.
dlls/ws2_32/socket.c
View file @
f21b25ae
...
...
@@ -8450,6 +8450,7 @@ INT WINAPI InetPtonW(INT family, PCWSTR addr, PVOID buffer)
WideCharToMultiByte
(
CP_ACP
,
0
,
addr
,
-
1
,
addrA
,
len
,
NULL
,
NULL
);
ret
=
WS_inet_pton
(
family
,
addrA
,
buffer
);
if
(
!
ret
)
SetLastError
(
WSAEINVAL
);
HeapFree
(
GetProcessHeap
(),
0
,
addrA
);
return
ret
;
...
...
dlls/ws2_32/tests/sock.c
View file @
f21b25ae
...
...
@@ -5014,11 +5014,11 @@ static void test_inet_pton(void)
WSASetLastError
(
0xdeadbeef
);
ret
=
pInetPtonA
(
tests
[
i
].
family
,
tests
[
i
].
printable
,
buffer
);
ok
(
ret
==
tests
[
i
].
ret
,
"Test [%d]: Expected %d, got %d
\n
"
,
i
,
tests
[
i
].
ret
,
ret
);
err
=
WSAGetLastError
();
if
(
tests
[
i
].
ret
==
-
1
)
{
err
=
WSAGetLastError
();
ok
(
tests
[
i
].
err
==
err
,
"Test [%d]: Expected 0x%x, got 0x%x
\n
"
,
i
,
tests
[
i
].
err
,
err
);
}
else
ok
(
err
==
0xdeadbeef
,
"Test [%d]: Expected 0xdeadbeef, got 0x%x
\n
"
,
i
,
err
);
if
(
tests
[
i
].
ret
!=
1
)
continue
;
ok
(
memcmp
(
buffer
,
tests
[
i
].
raw_data
,
tests
[
i
].
family
==
AF_INET
?
sizeof
(
struct
in_addr
)
:
sizeof
(
struct
in6_addr
))
==
0
,
...
...
@@ -5041,11 +5041,14 @@ static void test_inet_pton(void)
WSASetLastError
(
0xdeadbeef
);
ret
=
pInetPtonW
(
tests
[
i
].
family
,
tests
[
i
].
printable
?
printableW
:
NULL
,
buffer
);
ok
(
ret
==
tests
[
i
].
ret
,
"Test [%d]: Expected %d, got %d
\n
"
,
i
,
tests
[
i
].
ret
,
ret
);
err
=
WSAGetLastError
();
if
(
tests
[
i
].
ret
==
-
1
)
{
err
=
WSAGetLastError
();
ok
(
tests
[
i
].
err
==
err
,
"Test [%d]: Expected 0x%x, got 0x%x
\n
"
,
i
,
tests
[
i
].
err
,
err
);
}
else
if
(
tests
[
i
].
ret
==
0
)
ok
(
err
==
WSAEINVAL
||
broken
(
err
==
0xdeadbeef
)
/* win2008 */
,
"Test [%d]: Expected WSAEINVAL, got 0x%x
\n
"
,
i
,
err
);
else
ok
(
err
==
0xdeadbeef
,
"Test [%d]: Expected 0xdeadbeef, got 0x%x
\n
"
,
i
,
err
);
if
(
tests
[
i
].
ret
!=
1
)
continue
;
ok
(
memcmp
(
buffer
,
tests
[
i
].
raw_data
,
tests
[
i
].
family
==
AF_INET
?
sizeof
(
struct
in_addr
)
:
sizeof
(
struct
in6_addr
))
==
0
,
...
...
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