diff options
author | Pierre Lebleu <pme.lebleu@gmail.com> | 2017-05-04 10:50:56 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2017-05-09 23:54:15 +0200 |
commit | 6039c7f4b0052c4da21520cdd604f04a5a67f50d (patch) | |
tree | 3a4c8d563950f53a6f4b51f5ef63a2483f3642ff | |
parent | c328d1f6fe982888b5f5852423ee0a41cee3adb1 (diff) | |
download | firewall3-6039c7f4b0052c4da21520cdd604f04a5a67f50d.tar.gz |
firewall3: check the return value of fw3_parse_options()
The return value of fw3_parse_options() should be checked.
Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
-rw-r--r-- | defaults.c | 3 | ||||
-rw-r--r-- | forwards.c | 3 | ||||
-rw-r--r-- | includes.c | 3 | ||||
-rw-r--r-- | ipsets.c | 3 | ||||
-rw-r--r-- | zones.c | 3 |
5 files changed, 10 insertions, 5 deletions
@@ -107,7 +107,8 @@ fw3_load_defaults(struct fw3_state *state, struct uci_package *p) continue; } - fw3_parse_options(&state->defaults, fw3_flag_opts, s); + if(!fw3_parse_options(&state->defaults, fw3_flag_opts, s)) + warn_elem(e, "has invalid options"); check_policy(e, &defs->policy_input, "input"); check_policy(e, &defs->policy_output, "output"); @@ -54,7 +54,8 @@ fw3_load_forwards(struct fw3_state *state, struct uci_package *p) forward->enabled = true; - fw3_parse_options(forward, fw3_forward_opts, s); + if (!fw3_parse_options(forward, fw3_forward_opts, s)) + warn_elem(e, "has invalid options"); if (!forward->enabled) { @@ -54,7 +54,8 @@ fw3_load_includes(struct fw3_state *state, struct uci_package *p) include->name = e->name; include->enabled = true; - fw3_parse_options(include, fw3_include_opts, s); + if (!fw3_parse_options(include, fw3_include_opts, s)) + warn_elem(e, "has invalid options"); if (!include->enabled) { @@ -239,7 +239,8 @@ fw3_load_ipsets(struct fw3_state *state, struct uci_package *p) if (!ipset) continue; - fw3_parse_options(ipset, fw3_ipset_opts, s); + if (!fw3_parse_options(ipset, fw3_ipset_opts, s)) + warn_elem(e, "has invalid options"); if (ipset->external) { @@ -171,7 +171,8 @@ fw3_load_zones(struct fw3_state *state, struct uci_package *p) if (!zone) continue; - fw3_parse_options(zone, fw3_zone_opts, s); + if (!fw3_parse_options(zone, fw3_zone_opts, s)) + warn_elem(e, "has invalid options"); if (!zone->enabled) { |