diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | buffer.c | 8 |
2 files changed, 11 insertions, 2 deletions
@@ -39,6 +39,9 @@ | |||
39 | - markus@cvs.openbsd.org 2002/06/26 08:53:12 | 39 | - markus@cvs.openbsd.org 2002/06/26 08:53:12 |
40 | [bufaux.c] | 40 | [bufaux.c] |
41 | limit size of BNs to 8KB; ok provos/deraadt | 41 | limit size of BNs to 8KB; ok provos/deraadt |
42 | - markus@cvs.openbsd.org 2002/06/26 08:54:18 | ||
43 | [buffer.c] | ||
44 | limit append to 1MB and buffers to 10MB | ||
42 | 45 | ||
43 | 20020625 | 46 | 20020625 |
44 | - (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh | 47 | - (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh |
@@ -1138,4 +1141,4 @@ | |||
1138 | - (stevesk) entropy.c: typo in debug message | 1141 | - (stevesk) entropy.c: typo in debug message |
1139 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ | 1142 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ |
1140 | 1143 | ||
1141 | $Id: ChangeLog,v 1.2290 2002/06/26 09:14:08 djm Exp $ | 1144 | $Id: ChangeLog,v 1.2291 2002/06/26 09:14:25 djm Exp $ |
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: buffer.c,v 1.15 2002/01/18 18:14:17 stevesk Exp $"); | 15 | RCSID("$OpenBSD: buffer.c,v 1.16 2002/06/26 08:54:18 markus Exp $"); |
16 | 16 | ||
17 | #include "xmalloc.h" | 17 | #include "xmalloc.h" |
18 | #include "buffer.h" | 18 | #include "buffer.h" |
@@ -71,6 +71,9 @@ buffer_append_space(Buffer *buffer, u_int len) | |||
71 | { | 71 | { |
72 | void *p; | 72 | void *p; |
73 | 73 | ||
74 | if (len > 0x100000) | ||
75 | fatal("buffer_append_space: len %u not supported", len); | ||
76 | |||
74 | /* If the buffer is empty, start using it from the beginning. */ | 77 | /* If the buffer is empty, start using it from the beginning. */ |
75 | if (buffer->offset == buffer->end) { | 78 | if (buffer->offset == buffer->end) { |
76 | buffer->offset = 0; | 79 | buffer->offset = 0; |
@@ -96,6 +99,9 @@ restart: | |||
96 | } | 99 | } |
97 | /* Increase the size of the buffer and retry. */ | 100 | /* Increase the size of the buffer and retry. */ |
98 | buffer->alloc += len + 32768; | 101 | buffer->alloc += len + 32768; |
102 | if (buffer->alloc > 0xa00000) | ||
103 | fatal("buffer_append_space: alloc %u not supported", | ||
104 | buffer->alloc); | ||
99 | buffer->buf = xrealloc(buffer->buf, buffer->alloc); | 105 | buffer->buf = xrealloc(buffer->buf, buffer->alloc); |
100 | goto restart; | 106 | goto restart; |
101 | /* NOTREACHED */ | 107 | /* NOTREACHED */ |