]>
Commit | Line | Data |
---|---|---|
091368d2 MM |
1 | --- buffer.c~ Tue Sep 16 16:18:17 2003 |
2 | +++ buffer.c Tue Sep 16 16:26:59 2003 | |
3 | @@ -69,6 +69,7 @@ | |
4 | void * | |
5 | buffer_append_space(Buffer *buffer, u_int len) | |
6 | { | |
7 | + u_int newlen; | |
8 | void *p; | |
9 | ||
10 | /* If the buffer is empty, start using it from the beginning. */ | |
11 | @@ -95,8 +96,11 @@ | |
12 | goto restart; | |
13 | } | |
14 | /* Increase the size of the buffer and retry. */ | |
15 | - buffer->alloc += len + 32768; | |
16 | - buffer->buf = xrealloc(buffer->buf, buffer->alloc); | |
17 | + newlen = buffer->alloc + len + 32768; | |
18 | + if (newlen > 0xa00000) | |
19 | + fatal("buffer_append_space: alloc %u not supported", newlen); | |
20 | + buffer->buf = xrealloc(buffer->buf, newlen); | |
21 | + buffer->alloc = newlen; | |
22 | goto restart; | |
23 | /* NOTREACHED */ | |
24 | } |