Package: libnet1
Version: 1.1.2.1-2
Severity: important
Tags: patch

While investigating 418975 I notices that libnet_pblock_coalesce() will
leak l if an error is encountered. I'm not sure how widespread this
problem is in libnet. But in this case the fix is simple enough.

Index: libnet-1.1.2.1-wip/src/libnet_pblock.c
===================================================================
--- libnet-1.1.2.1-wip.orig/src/libnet_pblock.c 2007-04-13 14:47:17.000000000 
+0900
+++ libnet-1.1.2.1-wip/src/libnet_pblock.c      2007-04-13 14:47:19.000000000 
+0900
@@ -339,7 +339,7 @@
                     snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, 
                     "%s(): packet assembly cannot find a layer 2 header\n",
                     __func__);
-                    return (-1);
+                    goto err;
                 }
                 break;
             case LIBNET_RAW4:
@@ -348,7 +348,7 @@
                     snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, 
                     "%s(): packet assembly cannot find an IPv4 header\n",
                      __func__);
-                    return (-1);
+                    goto err;
                 }
                 break;
             case LIBNET_RAW6:
@@ -357,7 +357,7 @@
                     snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, 
                     "%s(): packet assembly cannot find an IPv6 header\n",
                      __func__);
-                    return (-1);
+                    goto err;
                 }
                 break;
             default:
@@ -365,7 +365,7 @@
                 snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, 
                 "%s(): suddenly the dungeon collapses -- you die\n",
                  __func__);
-                return (-1);
+                goto err;
             break;
         }
     }
@@ -419,6 +419,10 @@
         *size -= l->aligner;
     }
     return (1);
+
+err:
+    free(packet);
+    return (-1);
 }
 
 void

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (190, 'unstable'), (180, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-686 (SMP w/2 CPU cores)
Locale: LANG=ja_JP.utf8, LC_CTYPE=ja_JP.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to ja_JP.utf8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libnet1 depends on:
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries

libnet1 recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to