]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/io/gzio.c (huft_build): Use zalloc for safety.
authorVladimir Serbinenko <phcoder@gmail.com>
Wed, 30 Oct 2013 10:58:00 +0000 (11:58 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Wed, 30 Oct 2013 10:58:00 +0000 (11:58 +0100)
(initialize_tables): reset tl and td to NULL after freeing.

ChangeLog
grub-core/io/gzio.c

index 93fe8be25b0549e04fb12b09cd7f02c099e80bd5..6e9abacf6d1c24d68353c23fc672451ebaf31786 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-30  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/io/gzio.c (huft_build): Use zalloc for safety.
+       (initialize_tables): reset tl and td to NULL after freeing.
+
 2013-10-28  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/loader/multiboot_mbi2.c: Implement network tag.
index 50dc31ad4f1812af82094b2f26440224f348a1ee..6f93b30e46aaa16da2dfb8a1029a6d34c4b78567 100644 (file)
@@ -544,7 +544,7 @@ huft_build (unsigned *b,    /* code lengths in bits (all assumed <= BMAX) */
              z = 1 << j;       /* table entries for j-bit table */
 
              /* allocate and link in new table */
-             q = (struct huft *) grub_malloc ((z + 1) * sizeof (struct huft));
+             q = (struct huft *) grub_zalloc ((z + 1) * sizeof (struct huft));
              if (! q)
                {
                  if (h)
@@ -1118,6 +1118,8 @@ initialize_tables (grub_gzio_t gzio)
   /* Reset memory allocation stuff.  */
   huft_free (gzio->tl);
   huft_free (gzio->td);
+  gzio->tl = NULL;
+  gzio->td = NULL;
 }