summaryrefslogtreecommitdiffstats
path: root/crypto/openssh
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-09-16 06:11:58 +0000
committernectar <nectar@FreeBSD.org>2003-09-16 06:11:58 +0000
commitff50ba9baff8c8ced10334cd8d4f30108a1aba34 (patch)
tree453958903cf913c45e803b4a7e7ce02523921e15 /crypto/openssh
parent79eae078778daaa41c86b622212b0b1cbe1a540a (diff)
parent8cd211c5614d04163ef750283efd53dd2f129e68 (diff)
downloadFreeBSD-src-ff50ba9baff8c8ced10334cd8d4f30108a1aba34.zip
FreeBSD-src-ff50ba9baff8c8ced10334cd8d4f30108a1aba34.tar.gz
This commit was generated by cvs2svn to compensate for changes in r120113,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/openssh')
-rw-r--r--crypto/openssh/buffer.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/crypto/openssh/buffer.c b/crypto/openssh/buffer.c
index ad04b26..8ff8c2f 100644
--- a/crypto/openssh/buffer.c
+++ b/crypto/openssh/buffer.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: buffer.c,v 1.16 2002/06/26 08:54:18 markus Exp $");
+RCSID("$OpenBSD: buffer.c,v 1.17 2003/09/16 03:03:47 deraadt Exp $");
#include "xmalloc.h"
#include "buffer.h"
@@ -69,6 +69,7 @@ buffer_append(Buffer *buffer, const void *data, u_int len)
void *
buffer_append_space(Buffer *buffer, u_int len)
{
+ u_int newlen;
void *p;
if (len > 0x100000)
@@ -98,11 +99,13 @@ restart:
goto restart;
}
/* Increase the size of the buffer and retry. */
- buffer->alloc += len + 32768;
- if (buffer->alloc > 0xa00000)
+
+ newlen = buffer->alloc + len + 32768;
+ if (newlen > 0xa00000)
fatal("buffer_append_space: alloc %u not supported",
- buffer->alloc);
- buffer->buf = xrealloc(buffer->buf, buffer->alloc);
+ newlen);
+ buffer->buf = xrealloc(buffer->buf, newlen);
+ buffer->alloc = newlen;
goto restart;
/* NOTREACHED */
}
OpenPOWER on IntegriCloud