svn commit: r261408 - head/lib/libnv
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sun Feb 2 19:06:01 UTC 2014
Author: pjd
Date: Sun Feb 2 19:06:00 2014
New Revision: 261408
URL: http://svnweb.freebsd.org/changeset/base/261408
Log:
Assert input arguments to buf_send() and buf_recv().
Submitted by: Mariusz Zaborski <oshogbo at FreeBSD.org>
Modified:
head/lib/libnv/msgio.c
Modified: head/lib/libnv/msgio.c
==============================================================================
--- head/lib/libnv/msgio.c Sun Feb 2 19:03:52 2014 (r261407)
+++ head/lib/libnv/msgio.c Sun Feb 2 19:06:00 2014 (r261408)
@@ -338,6 +338,10 @@ buf_send(int sock, void *buf, size_t siz
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 siz
ssize_t done;
unsigned char *ptr;
+ PJDLOG_ASSERT(sock >= 0);
+ PJDLOG_ASSERT(buf != NULL);
+
ptr = buf;
while (size > 0) {
fd_wait(sock, true);
More information about the svn-src-all
mailing list