From 44c8c17c290ecefc681c5306819f051d3643246e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 8 Aug 2005 13:36:16 +0000 Subject: [PATCH] make writenet take const void * and size_t, abort if size it too large git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15844 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/telnet/telnetd/utility.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appl/telnet/telnetd/utility.c b/appl/telnet/telnetd/utility.c index 036e28960..61b81d237 100644 --- a/appl/telnet/telnetd/utility.c +++ b/appl/telnet/telnetd/utility.c @@ -323,13 +323,15 @@ netflush(void) * len - How many bytes to write */ void -writenet(unsigned char *ptr, int len) +writenet(const void *ptr, size_t len) { /* flush buffer if no room for new data) */ while ((&netobuf[BUFSIZ] - nfrontp) < len) { /* if this fails, don't worry, buffer is a little big */ netflush(); } + if ((&netobuf[BUFSIZ] - nfrontp) < len) + abort(); memmove(nfrontp, ptr, len); nfrontp += len;