summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2001-12-17 00:00:24 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2001-12-17 00:00:24 +0000
commitfdb4952e5f2db8d245e1be501848282835885701 (patch)
treed6e21be8cd2ef2e6180bfc84412b897debbe3a47 /src
parent6919faea77c5f3614123c873641fcda011ef9c84 (diff)
downloadtinyproxy-fdb4952e5f2db8d245e1be501848282835885701.tar.gz
tinyproxy-fdb4952e5f2db8d245e1be501848282835885701.zip
Added the assert() calls to safe_write() to make sure the arguments are
sane.
Diffstat (limited to 'src')
-rw-r--r--src/sock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sock.c b/src/sock.c
index 67825b9..df35e38 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -1,4 +1,4 @@
-/* $Id: sock.c,v 1.20 2001-12-15 20:04:04 rjkaes Exp $
+/* $Id: sock.c,v 1.21 2001-12-17 00:00:24 rjkaes Exp $
*
* Sockets are created and destroyed here. When a new connection comes in from
* a client, we need to copy the socket and the create a second socket to the
@@ -279,6 +279,10 @@ safe_write(int fd, const char *buffer, size_t count)
ssize_t len;
size_t bytestosend;
+ assert(fd >= 0);
+ assert(buffer != NULL);
+ assert(count > 0);
+
bytestosend = count;
while (1) {