summaryrefslogtreecommitdiff
path: root/zones.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-05-22 16:09:59 +0200
committerJo-Philipp Wich <jow@openwrt.org>2013-05-22 16:12:46 +0200
commitc3a5b984f6cec4014c1120ee900a53b452eb9e32 (patch)
tree7f71ef019ce18a44d84d098664466e3c33071e73 /zones.c
parentc307c10ba8edb637c58db1449434fdd6b751f7f0 (diff)
downloadfirewall3-c3a5b984f6cec4014c1120ee900a53b452eb9e32.tar.gz
Limit zone names to 14 bytes
Diffstat (limited to 'zones.c')
-rw-r--r--zones.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/zones.c b/zones.c
index 3d3812c..4c17c68 100644
--- a/zones.c
+++ b/zones.c
@@ -189,6 +189,14 @@ fw3_load_zones(struct fw3_state *state, struct uci_package *p)
continue;
}
+ if (strlen(zone->name) > FW3_ZONE_MAXNAMELEN)
+ {
+ warn_elem(e, "must not have a name longer than %u characters",
+ FW3_ZONE_MAXNAMELEN);
+ fw3_free_zone(zone);
+ continue;
+ }
+
if (list_empty(&zone->networks) && list_empty(&zone->devices) &&
list_empty(&zone->subnets) && !zone->extra_src)
{