mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] zlib double-free fix
@ 2002-03-12 13:36 Lucio Maciel
  0 siblings, 0 replies; 2+ messages in thread
From: Lucio Maciel @ 2002-03-12 13:36 UTC (permalink / raw)
  To: linux-kernel


Here is a small patch to fix the double-free in drivers/net/zlib.c

its against 2.4.19-pre3 but works fine in others versions

-- 
::: Lucio Maciel
::: abslucio@terra.com.br
::: Absoluta.Net :::

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] zlib double-free fix
@ 2002-03-12 13:52 Lucio Maciel
  0 siblings, 0 replies; 2+ messages in thread
From: Lucio Maciel @ 2002-03-12 13:52 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]


Forgot to attach the diff... sorry...
so here it goes..


Here is a small patch to fix the double-free in drivers/net/zlib.c

its against 2.4.19-pre3 but works fine in others versions

-- 
::: Lucio Maciel
::: abslucio@terra.com.br
::: Absoluta.Net :::

[-- Attachment #2: zlib.diff --]
[-- Type: application/octet-stream, Size: 1119 bytes --]

--- drivers/net/zlib.c.orig	Tue Mar 12 10:15:16 2002
+++ drivers/net/zlib.c	Tue Mar 12 10:29:28 2002
@@ -3860,10 +3860,12 @@
                              &s->sub.trees.tb, z);
       if (t != Z_OK)
       {
-        ZFREE(z, s->sub.trees.blens);
         r = t;
         if (r == Z_DATA_ERROR)
+        {
           s->mode = BADB;
+          ZFREE(z, s->sub.trees.blens);
+        }
         LEAVE
       }
       s->sub.trees.index = 0;
@@ -3928,14 +3930,17 @@
 #endif
         t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
                                   s->sub.trees.blens, &bl, &bd, &tl, &td, z);
-        ZFREE(z, s->sub.trees.blens);
         if (t != Z_OK)
         {
           if (t == (uInt)Z_DATA_ERROR)
+          {
             s->mode = BADB;
+            ZFREE(z, s->sub.trees.blens);
+          }
           r = t;
           LEAVE
         }
+        ZFREE(z, s->sub.trees.blens);
         Tracev((stderr, "inflate:       trees ok, %d * %d bytes used\n",
               inflate_hufts, sizeof(inflate_huft)));
         if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-12 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-12 13:36 [PATCH] zlib double-free fix Lucio Maciel
2002-03-12 13:52 Lucio Maciel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®