diff options
author | Jacques Vidrine <nectar@FreeBSD.org> | 2003-09-16 12:43:10 +0000 |
---|---|---|
committer | Jacques Vidrine <nectar@FreeBSD.org> | 2003-09-16 12:43:10 +0000 |
commit | 4cb3944f15119757f96bc88eb260fd8774fa4a2c (patch) | |
tree | 00e9c4281320cb63e9da2e41ee0982bd028bfbf4 /security/hpn-ssh | |
parent | Fix for 4.*. (diff) |
Do not record expanded size before attempting to reallocate associated
memory.
Obtained from: OpenBSD
Diffstat (limited to 'security/hpn-ssh')
-rw-r--r-- | security/hpn-ssh/Makefile | 1 | ||||
-rw-r--r-- | security/hpn-ssh/files/patch-buffer.c | 39 |
2 files changed, 40 insertions, 0 deletions
diff --git a/security/hpn-ssh/Makefile b/security/hpn-ssh/Makefile index ff5e4c9dbe14..e5be325edfb4 100644 --- a/security/hpn-ssh/Makefile +++ b/security/hpn-ssh/Makefile @@ -7,6 +7,7 @@ PORTNAME= openssh PORTVERSION= 3.6.1p2 +PORTREVISION= 1 CATEGORIES= security ipv6 MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \ ftp://carroll.cac.psu.edu/pub/OpenBSD/OpenSSH/portable/ diff --git a/security/hpn-ssh/files/patch-buffer.c b/security/hpn-ssh/files/patch-buffer.c new file mode 100644 index 000000000000..80fcad726108 --- /dev/null +++ b/security/hpn-ssh/files/patch-buffer.c @@ -0,0 +1,39 @@ +*** buffer.c.orig Sat Jun 29 06:33:59 2002 +--- buffer.c Tue Sep 16 00:33:54 2003 +*************** +*** 69,74 **** +--- 69,75 ---- + void * + buffer_append_space(Buffer *buffer, u_int len) + { ++ u_int newlen; + void *p; + + if (len > 0x100000) +*************** +*** 98,108 **** + goto 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 */ + } +--- 99,111 ---- + goto restart; + } + /* Increase the size of the buffer and retry. */ +! +! 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; + /* NOTREACHED */ + } |