summaryrefslogtreecommitdiffstats
path: root/libiptc
diff options
context:
space:
mode:
authorgandalf <gandalf>2004-09-22 22:04:07 +0000
committergandalf <gandalf>2004-09-22 22:04:07 +0000
commit3afd646e44e79bc6b1559bd7a363c9a5c3777c4b (patch)
tree46f196c30ee15440fe558be553bbfdf4ad6645f8 /libiptc
parent759fba07e189cd7f28a04af20cc14552faef4a51 (diff)
Make sure to zero all the memory we allocate for the new table.
Makes flushing of chains containing more than a few entries work without potentially oopsing the kernel.
Diffstat (limited to 'libiptc')
-rw-r--r--libiptc/libiptc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index 7c711b1..957af67 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -1,4 +1,4 @@
-/* Library which manipulates firewall rules. Version $Revision: 1.54 $ */
+/* Library which manipulates firewall rules. Version $Revision: 1.55 $ */
/* Architecture of firewall rules is as follows:
*
@@ -1962,7 +1962,7 @@ TC_COMMIT(TC_HANDLE_T *handle)
errno = ENOMEM;
return 0;
}
- memset(repl, 0, sizeof(*repl));
+ memset(repl, 0, sizeof(*repl) + new_size);
counterlen = sizeof(STRUCT_COUNTERS_INFO)
+ sizeof(STRUCT_COUNTERS) * new_number;