aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2003-09-16 17:51:06 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2003-09-16 17:51:06 +0000
commite745aa7ea0463ee74f565b1963c8b9e96356d1a1 (patch)
tree0cf5d0c9351a49f47083932c604ed9d8679f1bfe
parent51deb98c79dde1b7ec00f541ce5c4aaefdc84332 (diff)
downloadsrc-e745aa7ea0463ee74f565b1963c8b9e96356d1a1.tar.gz
src-e745aa7ea0463ee74f565b1963c8b9e96356d1a1.zip
MFC buffer.c 1.1.1.7: Do not record expanded size before attempting to
reallocate associated memory.
Notes
Notes: svn path=/releng/4.3/; revision=120133
-rw-r--r--UPDATING3
-rw-r--r--crypto/openssh/buffer.c10
-rw-r--r--crypto/openssh/version.h2
-rw-r--r--sys/conf/newvers.sh2
4 files changed, 13 insertions, 4 deletions
diff --git a/UPDATING b/UPDATING
index 6193b22f945c..64125afbd15b 100644
--- a/UPDATING
+++ b/UPDATING
@@ -16,6 +16,9 @@ minimal number of processes, if possible, for that patch. For those
updates that don't have an advisory, or to be safe, you can do a full
build and install as described in the COMMON ITEMS section.
+20030916: p36 FreeBSD-SA-03:12.openssh
+ OpenSSH oversized packet buffer handling corrected.
+
20030810: p35 FreeBSD-SA-03:10.iBCS2
iBCS2 system call translator for statfs leaked information.
diff --git a/crypto/openssh/buffer.c b/crypto/openssh/buffer.c
index d993c8bcdef8..f7dc45eb9ef0 100644
--- a/crypto/openssh/buffer.c
+++ b/crypto/openssh/buffer.c
@@ -69,6 +69,8 @@ buffer_append(Buffer *buffer, const char *data, unsigned int len)
void
buffer_append_space(Buffer *buffer, char **datap, unsigned int len)
{
+ u_int newlen;
+
/* If the buffer is empty, start using it from the beginning. */
if (buffer->offset == buffer->end) {
buffer->offset = 0;
@@ -93,8 +95,12 @@ restart:
goto restart;
}
/* Increase the size of the buffer and retry. */
- buffer->alloc += len + 32768;
- buffer->buf = xrealloc(buffer->buf, buffer->alloc);
+ newlen = buffer->alloc + len + 32768;
+ if (newlen > 0xa00000)
+ fatal("buffer_append_space: alloc %u not supported",
+ newlen);
+ buffer->buf = xrealloc(buffer->buf, newlen);
+ buffer->alloc = newlen;
goto restart;
}
diff --git a/crypto/openssh/version.h b/crypto/openssh/version.h
index 899adbb85346..b1a163ef4d8d 100644
--- a/crypto/openssh/version.h
+++ b/crypto/openssh/version.h
@@ -1,4 +1,4 @@
/* $FreeBSD$ */
/* $OpenBSD: version.h,v 1.13 2000/10/16 09:38:45 djm Exp $ */
-#define SSH_VERSION "OpenSSH_2.3.0 green@FreeBSD.org 20020307"
+#define SSH_VERSION "OpenSSH_2.3.0 green@FreeBSD.org 20030916"
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 2b8f7e143022..d74458e0e297 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -36,7 +36,7 @@
TYPE="FreeBSD"
REVISION="4.3"
-BRANCH="RELEASE-p35"
+BRANCH="RELEASE-p36"
RELEASE="${REVISION}-${BRANCH}"
VERSION="${TYPE} ${RELEASE}"