rpms/iftop/EL-4 iftop-0.17-fixtree.patch, NONE, 1.1 iftop-0.17-synopsis.patch, NONE, 1.1

Robert Scheck robert at fedoraproject.org
Fri Jul 9 22:19:59 UTC 2010


Author: robert

Update of /cvs/pkgs/rpms/iftop/EL-4
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv15252/EL-4

Added Files:
	iftop-0.17-fixtree.patch iftop-0.17-synopsis.patch 
Log Message:
- Corrected the wrong synopsis for -F/-N parameter (#601087 #c3)
- Added patch to avoid pointer with free(ed) memory (#601087 #c2)


iftop-0.17-fixtree.patch:
 stringmap.c |   10 ++++++++++
 stringmap.h |    2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

--- NEW FILE iftop-0.17-fixtree.patch ---
Patch by Michal Hlavinka <mhlavink at redhat.com> for iftop >= 0.17, which
fixes a problem in the stringmap implementation. When removing some node
from the tree, node itself is deallocated, but parent's pointer remains
set. This results to pointer with free(ed) memory. Further details can be
found at: https://bugzilla.redhat.com/show_bug.cgi?id=601087

--- iftop-0.17/stringmap.c		2003-11-07 00:37:20.000000000 +0100
+++ iftop-0.17/stringmap.c.fixtree	2010-07-09 23:53:18.000000000 +0200
@@ -34,6 +34,10 @@
     if (!S) return;
     if (S->l) stringmap_delete(S->l);
     if (S->g) stringmap_delete(S->g);
+    if (S->p) {
+        if (S->p->l == S) S->p->l = NULL;
+        else S->p->g = NULL;
+    }
 
     xfree(S->key);
     xfree(S);
@@ -46,6 +50,10 @@
     if (!S) return;
     if (S->l) stringmap_delete_free(S->l);
     if (S->g) stringmap_delete_free(S->g);
+    if (S->p) {
+        if (S->p->l == S) S->p->l = NULL;
+        else S->p->g = NULL;
+    }
 
     xfree(S->key);
     xfree(S->d.v);
@@ -75,6 +83,7 @@
                     if (!(S2->l = stringmap_new())) return NULL;
                     S2->l->key = xstrdup(k);
                     S2->l->d   = d;
+                    S2->l->p   = S2;
                     return NULL;
                 }
             } else if (i > 0) {
@@ -83,6 +92,7 @@
                     if (!(S2->g = stringmap_new())) return NULL;
                     S2->g->key = xstrdup(k);
                     S2->g->d   = d;
+                    S2->g->p   = S2;
                     return NULL;
                 }
             }
--- iftop-0.17/stringmap.h		2003-10-19 08:44:33.000000000 +0200
+++ iftop-0.17/stringmap.h.fixtree	2010-07-09 23:53:37.000000000 +0200
@@ -16,7 +16,7 @@
 typedef struct _stringmap {
     char *key;
     item d;
-    struct _stringmap *l, *g;
+    struct _stringmap *l, *g, *p;
 } *stringmap;
 
 stringmap stringmap_new(void);

iftop-0.17-synopsis.patch:
 options.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE iftop-0.17-synopsis.patch ---
Patch by Robert Scheck <robert at fedoraproject.org> for iftop >= 0.17, which
corrects the wrong synopsis. According to "--help", it's "-F net/mask", not
"-N net/mask", because "-N" is "don't convert port numbers to services".

--- iftop-0.17/options.c		2006-02-08 03:57:44.000000000 +0100
+++ iftop-0.17/options.c.synopsis	2010-07-10 00:02:49.000000000 +0200
@@ -237,7 +237,7 @@
     fprintf(fp,
 "iftop: display bandwidth usage on an interface by host\n"
 "\n"
-"Synopsis: iftop -h | [-npbBP] [-i interface] [-f filter code] [-N net/mask]\n"
+"Synopsis: iftop -h | [-npbNBP] [-i interface] [-f filter code] [-F net/mask]\n"
 "\n"
 "   -h                  display this message\n"
 "   -n                  don't do hostname lookups\n"



More information about the scm-commits mailing list