Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
79387b2f
Commit
79387b2f
authored
Feb 07, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Forbid passing zero buffers to WSARecv().
parent
9df04bfd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
socket.c
dlls/ws2_32/socket.c
+6
-0
sock.c
dlls/ws2_32/tests/sock.c
+2
-2
No files found.
dlls/ws2_32/socket.c
View file @
79387b2f
...
...
@@ -4035,6 +4035,12 @@ int WINAPI WSARecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
LPWSAOVERLAPPED
lpOverlapped
,
LPWSAOVERLAPPED_COMPLETION_ROUTINE
lpCompletionRoutine
)
{
if
(
!
dwBufferCount
)
{
SetLastError
(
WSAEINVAL
);
return
-
1
;
}
return
WS2_recv_base
(
s
,
lpBuffers
,
dwBufferCount
,
NumberOfBytesReceived
,
lpFlags
,
NULL
,
NULL
,
lpOverlapped
,
lpCompletionRoutine
,
NULL
);
}
...
...
dlls/ws2_32/tests/sock.c
View file @
79387b2f
...
...
@@ -12811,14 +12811,14 @@ static void test_empty_recv(void)
WSASetLastError
(
0xdeadbeef
);
ret
=
WSARecv
(
client
,
NULL
,
0
,
NULL
,
&
flags
,
&
overlapped
,
NULL
);
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
wsabuf
.
buf
=
buffer
;
wsabuf
.
len
=
0
;
WSASetLastError
(
0xdeadbeef
);
ret
=
WSARecv
(
client
,
&
wsabuf
,
0
,
NULL
,
&
flags
,
&
overlapped
,
NULL
);
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
WSASetLastError
(
0xdeadbeef
);
ret
=
WSARecv
(
client
,
&
wsabuf
,
1
,
NULL
,
&
flags
,
&
overlapped
,
NULL
);
...
...
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