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
6ec5b57a
Commit
6ec5b57a
authored
Aug 05, 2018
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Aug 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Improve parameter checking for IcmpSendEcho().
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3825be96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
icmp.c
dlls/iphlpapi/icmp.c
+7
-2
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+0
-8
No files found.
dlls/iphlpapi/icmp.c
View file @
6ec5b57a
...
...
@@ -288,11 +288,16 @@ DWORD WINAPI IcmpSendEcho(
if
(
IcmpHandle
==
INVALID_HANDLE_VALUE
)
{
/* FIXME: in fact win98 seems to ignore the handle value !!! */
SetLastError
(
ERROR_INVALID_HANDLE
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
ReplyBuffer
||!
ReplySize
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
ReplySize
<
sizeof
(
ICMP_ECHO_REPLY
)
+
ICMP_MINLEN
)
{
if
(
ReplySize
<
sizeof
(
ICMP_ECHO_REPLY
))
{
SetLastError
(
IP_BUF_TOO_SMALL
);
return
0
;
}
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
6ec5b57a
...
...
@@ -966,7 +966,6 @@ static void testIcmpSendEcho(void)
ret
=
pIcmpSendEcho
(
INVALID_HANDLE_VALUE
,
address
,
senddata
,
sizeof
(
senddata
),
NULL
,
replydata
,
replysz
,
1000
);
error
=
GetLastError
();
ok
(
!
ret
,
"IcmpSendEcho succeeded unexpectedly
\n
"
);
todo_wine
ok
(
error
==
ERROR_INVALID_PARAMETER
||
broken
(
error
==
ERROR_INVALID_HANDLE
)
/* <= 2003 */
,
"expected 87, got %d
\n
"
,
error
);
...
...
@@ -1009,20 +1008,16 @@ todo_wine
error
=
GetLastError
();
ok
(
ret
,
"IcmpSendEcho failed unexpectedly with error %d
\n
"
,
error
);
if
(
0
)
/* crashes in wine, remove IF when fixed */
{
SetLastError
(
0xdeadbeef
);
ret
=
pIcmpSendEcho
(
icmp
,
address
,
senddata
,
sizeof
(
senddata
),
NULL
,
NULL
,
replysz
,
1000
);
error
=
GetLastError
();
ok
(
!
ret
,
"IcmpSendEcho succeeded unexpectedly
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"expected 87, got %d
\n
"
,
error
);
}
SetLastError
(
0xdeadbeef
);
ret
=
pIcmpSendEcho
(
icmp
,
address
,
senddata
,
sizeof
(
senddata
),
NULL
,
replydata
,
0
,
1000
);
error
=
GetLastError
();
ok
(
!
ret
,
"IcmpSendEcho succeeded unexpectedly
\n
"
);
todo_wine
ok
(
error
==
ERROR_INVALID_PARAMETER
||
broken
(
error
==
ERROR_INSUFFICIENT_BUFFER
)
/* <= 2003 */
,
"expected 87, got %d
\n
"
,
error
);
...
...
@@ -1031,7 +1026,6 @@ todo_wine
ret
=
pIcmpSendEcho
(
icmp
,
address
,
senddata
,
sizeof
(
senddata
),
NULL
,
NULL
,
0
,
1000
);
error
=
GetLastError
();
ok
(
!
ret
,
"IcmpSendEcho succeeded unexpectedly
\n
"
);
todo_wine
ok
(
error
==
ERROR_INVALID_PARAMETER
||
broken
(
error
==
ERROR_INSUFFICIENT_BUFFER
)
/* <= 2003 */
,
"expected 87, got %d
\n
"
,
error
);
...
...
@@ -1049,7 +1043,6 @@ todo_wine
replysz
=
sizeof
(
ICMP_ECHO_REPLY
);
ret
=
pIcmpSendEcho
(
icmp
,
address
,
senddata
,
0
,
NULL
,
replydata
,
replysz
,
1000
);
error
=
GetLastError
();
todo_wine
ok
(
ret
,
"IcmpSendEcho failed unexpectedly with error %d
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
...
...
@@ -1071,7 +1064,6 @@ todo_wine
ret
=
pIcmpSendEcho
(
icmp
,
address
,
senddata
,
ICMP_MINLEN
,
NULL
,
replydata
,
replysz
-
1
,
1000
);
error
=
GetLastError
();
ok
(
!
ret
,
"IcmpSendEcho succeeded unexpectedly
\n
"
);
todo_wine
ok
(
error
==
IP_GENERAL_FAILURE
||
broken
(
error
==
IP_BUF_TOO_SMALL
)
/* <= 2003 */
,
"expected 11050, got %d
\n
"
,
error
);
...
...
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