Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: pu

Dear release team,

I am the new maintainer for iftop. I would like to update the version
of iftop in stable because of bug #677141.

When dns resolution is turned off, iftop's memory usage will increase
constantly because a struct is always allocated, though it will never be
freed. You can easily reproduce the bug with

iftop -n -i lo
ping -f localhost

Without the -n parameter there is no memory leak.

This is already fixed in unstable and testing but since
turning off dns resolution is a regular use case, I think it should be
fixed in stable, too.

The other important changes include a stricter versioned dependency on debhelper
(>= 9) and a switch to source format 3.0 for applying the new patch
without further changes.

I'm attaching the debdiff to this bug report.

Regards,

Markus
diff -Nru iftop-1.0~pre2/debian/changelog iftop-1.0~pre2/debian/changelog
--- iftop-1.0~pre2/debian/changelog	2013-10-30 10:36:28.000000000 +0100
+++ iftop-1.0~pre2/debian/changelog	2013-10-30 10:22:46.000000000 +0100
@@ -1,3 +1,24 @@
+iftop (1.0~pre2-4~deb7u1) stable; urgency=low
+
+  * Rebuild for Wheezy.
+
+ -- Markus Koschany <a...@gambaru.de>  Wed, 30 Oct 2013 10:17:32 +0100
+
+iftop (1.0~pre2-4) unstable; urgency=low
+
+  * [488690e] New Maintainer. (Closes: #726549)
+  * [06096f6] Add memory-leak.patch.
+     - Fix a memory leak in resolver.c. The struct addr_storage was allocated
+       but never freed if dns resolution was turned off. Thanks to Olivier
+       Allard-Jacquin for the report and patch. (Closes: #677141)
+  * [ab3dd6a] Update VCS-fields.
+     - Move packaging to Git repository at collab-maint.
+  * [580ac7d] Require debhelper >= 9 for compat level 9. (Closes: #693754)
+  * [b881f79] Switch to source format 3.0 (quilt).
+  * [66bb584] Bump Standards-Version to 3.9.4, no changes.
+
+ -- Markus Koschany <a...@gambaru.de>  Sat, 19 Oct 2013 11:26:10 +0200
+
 iftop (1.0~pre2-3) unstable; urgency=low
 
   * Enable hardening buildflags in debian/rules (Closes: #675849)
diff -Nru iftop-1.0~pre2/debian/control iftop-1.0~pre2/debian/control
--- iftop-1.0~pre2/debian/control	2013-10-30 10:36:28.000000000 +0100
+++ iftop-1.0~pre2/debian/control	2013-10-30 10:22:46.000000000 +0100
@@ -1,12 +1,12 @@
 Source: iftop
 Section: net
 Priority: optional
-Maintainer: Alexander Reichle-Schmehl <toli...@debian.org>
-Build-Depends: debhelper (>= 7.0.50~), autotools-dev, libncurses5-dev, libpcap0.8-dev
-Standards-Version: 3.9.3
+Maintainer: Markus Koschany <a...@gambaru.de>
+Build-Depends: debhelper (>= 9), autotools-dev, libncurses5-dev, libpcap0.8-dev
+Standards-Version: 3.9.4
 Homepage: http://www.ex-parrot.com/~pdw/iftop/
-Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/iftop/trunk/
-Vcs-Browser: http://svn.debian.org/viewsvn/collab-maint/deb-maint/iftop/
+Vcs-Git: git://anonscm.debian.org/collab-maint/iftop.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/iftop.git
 
 Package: iftop
 Architecture: any
diff -Nru iftop-1.0~pre2/debian/patches/memory-leak.patch iftop-1.0~pre2/debian/patches/memory-leak.patch
--- iftop-1.0~pre2/debian/patches/memory-leak.patch	1970-01-01 01:00:00.000000000 +0100
+++ iftop-1.0~pre2/debian/patches/memory-leak.patch	2013-10-30 10:22:46.000000000 +0100
@@ -0,0 +1,41 @@
+From: Olivier Allard-Jacquin <olivie...@free.fr>
+Date: Fri, 18 Oct 2013 23:39:00 +0200
+Subject: memory leak
+
+Fix a memory leak in resolver.c. The struct addr_storage was allocated
+but never freed if dns resolution was turned off. Thanks to Olivier
+Allard-Jacquin for the report and patch.
+
+Bug: http://bugs.debian.org/677141
+
+---
+ resolver.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/resolver.c b/resolver.c
+index c09de9d..e3b965d 100644
+--- a/resolver.c
++++ b/resolver.c
+@@ -472,15 +472,15 @@ void resolve(int af, void* addr, char* result, int buflen) {
+     int added = 0;
+     struct addr_storage *raddr;
+ 
+-    raddr = malloc(sizeof *raddr);
+-    memset(raddr, 0, sizeof *raddr);
+-    raddr->af = af;
+-    raddr->len = (af == AF_INET ? sizeof(struct in_addr)
+-                  : sizeof(struct in6_addr));
+-    memcpy(&raddr->addr, addr, raddr->len);
+-
+     if(options.dnsresolution == 1) {
+ 
++        raddr = malloc(sizeof *raddr);
++        memset(raddr, 0, sizeof *raddr);
++        raddr->af = af;
++        raddr->len = (af == AF_INET ? sizeof(struct in_addr)
++                  : sizeof(struct in6_addr));
++        memcpy(&raddr->addr, addr, raddr->len);
++
+         pthread_mutex_lock(&resolver_queue_mutex);
+ 
+         if(hash_find(ns_hash, raddr, u_hostname.void_pp) == HASH_STATUS_OK) {
diff -Nru iftop-1.0~pre2/debian/patches/series iftop-1.0~pre2/debian/patches/series
--- iftop-1.0~pre2/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ iftop-1.0~pre2/debian/patches/series	2013-10-30 10:22:46.000000000 +0100
@@ -0,0 +1 @@
+memory-leak.patch
diff -Nru iftop-1.0~pre2/debian/source/format iftop-1.0~pre2/debian/source/format
--- iftop-1.0~pre2/debian/source/format	1970-01-01 01:00:00.000000000 +0100
+++ iftop-1.0~pre2/debian/source/format	2013-10-30 10:22:46.000000000 +0100
@@ -0,0 +1 @@
+3.0 (quilt)

Reply via email to