summaryrefslogtreecommitdiffstats
path: root/extensions/libipt_recent.c
diff options
context:
space:
mode:
authorKarsten Desler <kdesler@soohrt.org>2004-01-31 15:33:55 +0000
committerMartin Josefsson <gandalf@wlug.westbo.se>2004-01-31 15:33:55 +0000
commit073df8feb0a8c4023ce40138e519ac9b341b1ca2 (patch)
treeb29bb39cfef731e863db577f1ff161e4bf5d3f5f /extensions/libipt_recent.c
parent617b7dd9ef2870e85694ad5212c61fa7c5986ec9 (diff)
Fix even more possibly not zero-terminated strings after copy (Karsten Desler)
Diffstat (limited to 'extensions/libipt_recent.c')
-rw-r--r--extensions/libipt_recent.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/extensions/libipt_recent.c b/extensions/libipt_recent.c
index aa32aa07..a3942720 100644
--- a/extensions/libipt_recent.c
+++ b/extensions/libipt_recent.c
@@ -75,6 +75,9 @@ init(struct ipt_entry_match *match, unsigned int *nfcache)
*nfcache |= NFC_UNKNOWN;
strncpy(info->name,"DEFAULT",IPT_RECENT_NAME_LEN);
+ /* eventhough IPT_RECENT_NAME_LEN is currently defined as 200,
+ * better be safe, than sorry */
+ info->name[IPT_RECENT_NAME_LEN-1] = '\0';
info->side = IPT_RECENT_SOURCE;
}
@@ -142,6 +145,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
case 208:
strncpy(info->name,optarg,IPT_RECENT_NAME_LEN);
+ info->name[IPT_RECENT_NAME_LEN-1] = '\0';
break;
case 209: