diff options
author | des <des@FreeBSD.org> | 2002-06-29 11:34:13 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-06-29 11:34:13 +0000 |
commit | 1ba793a7c09e24d920de3983a3223770cb37ebff (patch) | |
tree | 8238d8d0755b8c75c2f77d82c8f96d4360c7ee11 /crypto/openssh/buffer.c | |
parent | bb02848f18878bddada7a9f55b110116f63c2f3c (diff) | |
download | FreeBSD-src-1ba793a7c09e24d920de3983a3223770cb37ebff.zip FreeBSD-src-1ba793a7c09e24d920de3983a3223770cb37ebff.tar.gz |
Vendor import of OpenSSH 3.4p1.
Diffstat (limited to 'crypto/openssh/buffer.c')
-rw-r--r-- | crypto/openssh/buffer.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/openssh/buffer.c b/crypto/openssh/buffer.c index 40572e5..ad04b26 100644 --- a/crypto/openssh/buffer.c +++ b/crypto/openssh/buffer.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: buffer.c,v 1.15 2002/01/18 18:14:17 stevesk Exp $"); +RCSID("$OpenBSD: buffer.c,v 1.16 2002/06/26 08:54:18 markus Exp $"); #include "xmalloc.h" #include "buffer.h" @@ -71,6 +71,9 @@ buffer_append_space(Buffer *buffer, u_int len) { void *p; + if (len > 0x100000) + fatal("buffer_append_space: len %u not supported", len); + /* If the buffer is empty, start using it from the beginning. */ if (buffer->offset == buffer->end) { buffer->offset = 0; @@ -96,6 +99,9 @@ restart: } /* Increase the size of the buffer and retry. */ buffer->alloc += len + 32768; + if (buffer->alloc > 0xa00000) + fatal("buffer_append_space: alloc %u not supported", + buffer->alloc); buffer->buf = xrealloc(buffer->buf, buffer->alloc); goto restart; /* NOTREACHED */ |