From 334a8e902746f8fc30e0fad3928276a0c9235611 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 1 Dec 2010 12:47:30 +0100 Subject: [PATCH] Convert a static local buffer to be allocated dinamically. --- src/ChangeLog | 12 ++++++++---- src/retr.c | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5e5843f2..eacf9a4a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,12 @@ -2010-11-27 Reza Snowdon +2010-12-01 Giuseppe Scrivano - * init.c (initialize): If 'ok' is not zero; exit, as - this indicates there was a problem parsing 'SYSTEM_WGETRC'. - Fixes bug #20370 + * retr.c (fd_read_body): Dinamically allocate `dlbuf'. + +2010-11-27 Reza Snowdon + + * init.c (initialize): If 'ok' is not zero; exit, as this + indicates there was a problem parsing 'SYSTEM_WGETRC'. + Fixes bug #20370. 2010-11-22 Giuseppe Scrivano diff --git a/src/retr.c b/src/retr.c index 83f47bee..5dc3cc8d 100644 --- a/src/retr.c +++ b/src/retr.c @@ -209,8 +209,8 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos, { int ret = 0; - static char dlbuf[16384]; - int dlbufsize = sizeof (dlbuf); + int dlbufsize = BUFSIZ; + char *dlbuf = xmalloc (BUFSIZ); struct ptimer *timer = NULL; double last_successful_read_tm = 0; @@ -388,6 +388,8 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos, if (qtywritten) *qtywritten += sum_written; + free (dlbuf); + return ret; } -- 2.39.2