summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/buffer.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2005-06-05 15:41:57 +0000
committerdes <des@FreeBSD.org>2005-06-05 15:41:57 +0000
commitc4dfc1ed3bdacd05d73791b2c8f8b580511a939f (patch)
tree08ccf47ce923e292d8f5057f36d34f042b7a5e6d /crypto/openssh/buffer.c
parent11a09ab416e21c995885dc0e5847151627094217 (diff)
downloadFreeBSD-src-c4dfc1ed3bdacd05d73791b2c8f8b580511a939f.zip
FreeBSD-src-c4dfc1ed3bdacd05d73791b2c8f8b580511a939f.tar.gz
Vendor import of OpenSSH 4.1p1.
Diffstat (limited to 'crypto/openssh/buffer.c')
-rw-r--r--crypto/openssh/buffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/openssh/buffer.c b/crypto/openssh/buffer.c
index 1a25004..487e081 100644
--- a/crypto/openssh/buffer.c
+++ b/crypto/openssh/buffer.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: buffer.c,v 1.22 2004/10/29 23:56:17 djm Exp $");
+RCSID("$OpenBSD: buffer.c,v 1.23 2005/03/14 11:46:56 markus Exp $");
#include "xmalloc.h"
#include "buffer.h"
@@ -78,7 +78,7 @@ buffer_append_space(Buffer *buffer, u_int len)
u_int newlen;
void *p;
- if (len > 0x100000)
+ if (len > BUFFER_MAX_CHUNK)
fatal("buffer_append_space: len %u not supported", len);
/* If the buffer is empty, start using it from the beginning. */
@@ -97,7 +97,7 @@ restart:
* If the buffer is quite empty, but all data is at the end, move the
* data to the beginning and retry.
*/
- if (buffer->offset > buffer->alloc / 2) {
+ if (buffer->offset > MIN(buffer->alloc, BUFFER_MAX_CHUNK)) {
memmove(buffer->buf, buffer->buf + buffer->offset,
buffer->end - buffer->offset);
buffer->end -= buffer->offset;
@@ -107,7 +107,7 @@ restart:
/* Increase the size of the buffer and retry. */
newlen = buffer->alloc + len + 32768;
- if (newlen > 0xa00000)
+ if (newlen > BUFFER_MAX_LEN)
fatal("buffer_append_space: alloc %u not supported",
newlen);
buffer->buf = xrealloc(buffer->buf, newlen);
OpenPOWER on IntegriCloud