summaryrefslogtreecommitdiffstats
path: root/libiptc
diff options
context:
space:
mode:
author/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/emailAddress=kaber@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/emailAddress=kaber@netfilter.org>2006-07-20 17:18:44 +0000
committer/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/emailAddress=kaber@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/emailAddress=kaber@netfilter.org>2006-07-20 17:18:44 +0000
commit55c79c9d91f1125c5ef97e3046dbad832b32cc10 (patch)
treea80ff9f6fa1b0710d477d84a56138e5a0def0233 /libiptc
parent18c7ec36ac949aaaf28aa25d11c0289a88d35592 (diff)
[PATCH] BUG: libiptc chain references bug (Jesper Brouer <hawk@diku.dk>)
Correcting a chain references increment bug in libiptc. The bug lies in function iptc_delete_entry() / TC_DELETE_ENTRY. The problem is the construction of "r" the rule entry, that is used for comparison. The problem is that the function iptcc_map_target() increase the target chains references count.
Diffstat (limited to 'libiptc')
-rw-r--r--libiptc/libiptc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index 794904b..779df34 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -1519,6 +1519,14 @@ TC_DELETE_ENTRY(const IPT_CHAINLABEL chain,
DEBUGP("unable to map target of rule for chain `%s'\n", chain);
free(r);
return 0;
+ } else {
+ /* iptcc_map_target increment target chain references
+ * since this is a fake rule only used for matching
+ * the chain references count is decremented again.
+ */
+ if (r->type == IPTCC_R_JUMP
+ && r->jump)
+ r->jump->references--;
}
list_for_each_entry(i, &c->rules, list) {