iptables: fix regression with unintended free in need_protomatch
[project/firewall3.git] / xtables-5.h
index 352250025b57784ce05a08f659ac4be04abf4ec1..14b54aff06c5fd01a269781a9d1ccb068c11a5b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * firewall3 - 3rd OpenWrt UCI firewall implementation
  *
- *   Copyright (C) 2013 Jo-Philipp Wich <jow@openwrt.org>
+ *   Copyright (C) 2013 Jo-Philipp Wich <jo@mein.io>
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -36,7 +36,7 @@ fw3_xt_get_match_name(struct xtables_match *m)
 static inline void
 fw3_xt_set_match_name(struct xtables_match *m)
 {
-    strcpy(m->m->u.user.name, m->name);
+    snprintf(m->m->u.user.name, sizeof(m->m->u.user.name), "%s", m->name);
 }
 
 static inline bool
@@ -67,7 +67,7 @@ fw3_xt_get_target_name(struct xtables_target *t)
 static inline void
 fw3_xt_set_target_name(struct xtables_target *t, const char *name)
 {
-    strcpy(t->t->u.user.name, name);
+    snprintf(t->t->u.user.name, sizeof(t->t->u.user.name), "%s", name);
 }
 
 static inline bool
@@ -89,7 +89,7 @@ fw3_xt_merge_target_options(struct xtables_globals *g, struct xtables_target *t)
 }
 
 static inline void
-fw3_xt_print_matches(void *ip, struct xtables_match **matches)
+fw3_xt_print_matches(void *ip, struct xtables_rule_match *matches)
 {
        struct xtables_rule_match *rm;
        struct xtables_match *m;