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 <osho...@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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to