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
commitfebb761cf65a19978f3b68df1c9d6b5fe551a73d (patch)
tree5a433de6f40c013cd643adb743804056b8b576c7
parentfba38ede4ffeb129bb7ec1b3ea41d77f91e0c296 (diff)
downloadsrc-febb761cf65a19978f3b68df1c9d6b5fe551a73d.tar.gz
src-febb761cf65a19978f3b68df1c9d6b5fe551a73d.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.6/; revision=120133
-rw-r--r--UPDATING3
-rw-r--r--crypto/openssh/buffer.c11
-rw-r--r--crypto/openssh/version.h2
-rw-r--r--sys/conf/newvers.sh2
4 files changed, 12 insertions, 6 deletions
diff --git a/UPDATING b/UPDATING
index 88c9a29cdc3b..8314114e4adf 100644
--- a/UPDATING
+++ b/UPDATING
@@ -17,6 +17,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: p18 FreeBSD-SA-03:12.openssh
+ OpenSSH oversized packet buffer handling corrected.
+
20030825: p17 FreeBSD-SA-03:11.sendmail
Sendmail DNS map problem corrected.
diff --git a/crypto/openssh/buffer.c b/crypto/openssh/buffer.c
index ad04b267e0d8..9370998c97ce 100644
--- a/crypto/openssh/buffer.c
+++ b/crypto/openssh/buffer.c
@@ -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 */
}
diff --git a/crypto/openssh/version.h b/crypto/openssh/version.h
index 138ebf22040b..fb662d25ec93 100644
--- a/crypto/openssh/version.h
+++ b/crypto/openssh/version.h
@@ -5,7 +5,7 @@
#define SSH_VERSION (ssh_version_get())
#define SSH_VERSION_BASE "OpenSSH_3.4p1"
-#define SSH_VERSION_ADDENDUM "FreeBSD-20020702"
+#define SSH_VERSION_ADDENDUM "FreeBSD-20030916"
const char *ssh_version_get(void);
void ssh_version_set_addendum(const char *add);
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index a201a5da626e..b60416fd474e 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -36,7 +36,7 @@
TYPE="FreeBSD"
REVISION="4.6.2"
-BRANCH="RELEASE-p17"
+BRANCH="RELEASE-p18"
RELEASE="${REVISION}-${BRANCH}"
VERSION="${TYPE} ${RELEASE}"