]> sjero.net Git - wget/commitdiff
Convert a static local buffer to be allocated dinamically.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 1 Dec 2010 11:47:30 +0000 (12:47 +0100)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 1 Dec 2010 11:47:30 +0000 (12:47 +0100)
src/ChangeLog
src/retr.c

index 5e5843f2d3c19953247544f5b4a8be80848ad615..eacf9a4a0d9239a9705ef14045bf5d7c0b0f19da 100644 (file)
@@ -1,8 +1,12 @@
-2010-11-27  Reza Snowdon  <vivi@mage.me.uk> 
+2010-12-01  Giuseppe Scrivano  <gscrivano@gnu.org>
 
-        * 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  <vivi@mage.me.uk>
+
+        * 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  <gscrivano@gnu.org>
 
index 83f47beecd128e8a504c6d81a87f5a87cd5018e4..5dc3cc8d660f0692a2ccd52635aa3125d40d4d7d 100644 (file)
@@ -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;
 }
 \f