mirror of https://git.kore.io/kore.git
Fix off-by-one error when reallocing buffer
There was an invalid boundary check when appending to a buffer. The consequence of this was that the POST data buffer was deterministically realloced.
This commit is contained in:
parent
e580e6678e
commit
53e8220ff6
|
@ -32,7 +32,7 @@ kore_buf_create(u_int32_t initial)
|
|||
void
|
||||
kore_buf_append(struct kore_buf *buf, const void *d, u_int32_t len)
|
||||
{
|
||||
if ((buf->offset + len) >= buf->length) {
|
||||
if ((buf->offset + len) > buf->length) {
|
||||
buf->length += len + KORE_BUF_INCREMENT;
|
||||
buf->data = kore_realloc(buf->data, buf->length);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue