Assert input arguments to buf_send() and buf_recv().
Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
This commit is contained in:
parent
7f7fe890a5
commit
3d34ecea9a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261408
@ -338,6 +338,10 @@ buf_send(int sock, void *buf, size_t size)
|
||||
ssize_t done;
|
||||
unsigned char *ptr;
|
||||
|
||||
PJDLOG_ASSERT(sock >= 0);
|
||||
PJDLOG_ASSERT(size > 0);
|
||||
PJDLOG_ASSERT(buf != NULL);
|
||||
|
||||
ptr = buf;
|
||||
do {
|
||||
fd_wait(sock, false);
|
||||
@ -363,6 +367,9 @@ buf_recv(int sock, void *buf, size_t size)
|
||||
ssize_t done;
|
||||
unsigned char *ptr;
|
||||
|
||||
PJDLOG_ASSERT(sock >= 0);
|
||||
PJDLOG_ASSERT(buf != NULL);
|
||||
|
||||
ptr = buf;
|
||||
while (size > 0) {
|
||||
fd_wait(sock, true);
|
||||
|
Loading…
Reference in New Issue
Block a user