]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2002/06/26 08:54:18
authordjm <djm>
Wed, 26 Jun 2002 09:14:25 +0000 (09:14 +0000)
committerdjm <djm>
Wed, 26 Jun 2002 09:14:25 +0000 (09:14 +0000)
     [buffer.c]
     limit append to 1MB and buffers to 10MB

ChangeLog
buffer.c

index 0bcad49acfc1e86bfc38074d5e23013d8c2b62cd..33840488003110eb8f530c9c0e53634060c75960 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,9 @@
    - markus@cvs.openbsd.org 2002/06/26 08:53:12
      [bufaux.c]
      limit size of BNs to 8KB; ok provos/deraadt
+   - markus@cvs.openbsd.org 2002/06/26 08:54:18
+     [buffer.c]
+     limit append to 1MB and buffers to 10MB
 
 20020625
  - (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh
index 40572e5ac30e5c4e5e6ee8ced39b025377b78a8f..ad04b267e0d8c2493860a7c5fd1e067a954c767a 100644 (file)
--- a/buffer.c
+++ b/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 */
This page took 0.176124 seconds and 5 git commands to generate.