iptables-1.3.2-20050720
[iptables.git] / extensions / libipt_recent.c
index aa32aa0..0b0ed2d 100644 (file)
@@ -72,9 +72,11 @@ init(struct ipt_entry_match *match, unsigned int *nfcache)
 {
        struct ipt_recent_info *info = (struct ipt_recent_info *)(match)->data;
 
-       *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 +144,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: