projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
firewall3: check the return value of fw3_parse_options()
[project/firewall3.git]
/
utils.c
diff --git
a/utils.c
b/utils.c
index
aca98d5
..
875a141
100644
(file)
--- a/
utils.c
+++ b/
utils.c
@@
-463,11
+463,6
@@
write_zone_uci(struct uci_context *ctx, struct fw3_zone *z,
uci_set(ctx, &ptr);
ptr.o = NULL;
uci_set(ctx, &ptr);
ptr.o = NULL;
- ptr.option = "conntrack";
- ptr.value = z->conntrack ? "1" : "0";
- uci_set(ctx, &ptr);
-
- ptr.o = NULL;
ptr.option = "mtu_fix";
ptr.value = z->mtu_fix ? "1" : "0";
uci_set(ctx, &ptr);
ptr.option = "mtu_fix";
ptr.value = z->mtu_fix ? "1" : "0";
uci_set(ctx, &ptr);
@@
-490,18
+485,21
@@
write_zone_uci(struct uci_context *ctx, struct fw3_zone *z,
fw3_foreach(dev, &z->devices)
{
fw3_foreach(dev, &z->devices)
{
+ char *ep;
+
if (!dev)
continue;
p = buf;
if (!dev)
continue;
p = buf;
+ ep = buf + sizeof(buf);
if (dev->invert)
if (dev->invert)
- p += s
printf(
p, "!");
+ p += s
nprintf(p, ep -
p, "!");
if (*dev->network)
if (*dev->network)
- p += s
printf(
p, "%s@%s", dev->name, dev->network);
+ p += s
nprintf(p, ep -
p, "%s@%s", dev->name, dev->network);
else
else
- p += s
printf(
p, "%s", dev->name);
+ p += s
nprintf(p, ep -
p, "%s", dev->name);
ptr.value = buf;
uci_add_list(ctx, &ptr);
ptr.value = buf;
uci_add_list(ctx, &ptr);