diff options
author | pjd <pjd@FreeBSD.org> | 2014-02-02 19:06:00 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2014-02-02 19:06:00 +0000 |
commit | 7eae47c97858d0926ede728c2424be01b8a2d8be (patch) | |
tree | fd394c81e296d66b008fd4a17669acf5fa8639a6 | |
parent | 79b0db8823d11c46b10212aa43799100f7611bb2 (diff) | |
download | FreeBSD-src-7eae47c97858d0926ede728c2424be01b8a2d8be.zip FreeBSD-src-7eae47c97858d0926ede728c2424be01b8a2d8be.tar.gz |
Assert input arguments to buf_send() and buf_recv().
Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
-rw-r--r-- | lib/libnv/msgio.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libnv/msgio.c b/lib/libnv/msgio.c index 813b963..41292aa 100644 --- a/lib/libnv/msgio.c +++ b/lib/libnv/msgio.c @@ -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); |