commit dc46162ec7cebe3d80dcf943a64d5ebaf04326fb
parent 9fd5433a2daf4a6e8eab658367312fd37c1994ae
Author: Florian Dold <florian.dold@gmail.com>
Date: Mon, 23 May 2016 17:19:47 +0200
handle growing empty buffer
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/taler-merchant-httpd_parsing.c b/src/backend/taler-merchant-httpd_parsing.c
@@ -123,7 +123,7 @@ buffer_append (struct Buffer *buf,
if (data_size + buf->fill > buf->alloc)
{
char *new_buf;
- size_t new_size = buf->alloc;
+ size_t new_size = buf->alloc ? buf->alloc : 1;
while (new_size < buf->fill + data_size)
new_size *= 2;
if (new_size > max_size)