summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-01-13 12:46:37 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-13 12:46:37 +0100
commitadf87f3a36328b949ed777068b14d975b429f9ad (patch)
treed839cfc2a1865bcd361805b3ea9d032fcd339c36
parentc03e20d7f594058ff223f30cf34de1b5e8210b8d (diff)
downloadfirewall3-adf87f3a36328b949ed777068b14d975b429f9ad.tar.gz
redirects: fix possible null pointer access
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rw-r--r--redirects.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/redirects.c b/redirects.c
index a30c540..50ed44d 100644
--- a/redirects.c
+++ b/redirects.c
@@ -312,20 +312,20 @@ fw3_load_redirects(struct fw3_state *state, struct uci_package *p)
set(redir->_src->flags, FW3_FAMILY_V4, redir->target);
redir->_src->conntrack = true;
valid = true;
- }
- if (!check_local(e, redir, state) && !redir->dest.set &&
- resolve_dest(e, redir, state))
- {
- warn_elem(e, "does not specify a destination, assuming '%s'",
- redir->dest.name);
- }
+ if (!check_local(e, redir, state) && !redir->dest.set &&
+ resolve_dest(e, redir, state))
+ {
+ warn_elem(e, "does not specify a destination, assuming '%s'",
+ redir->dest.name);
+ }
- if (redir->reflection && redir->_dest && redir->_src->masq)
- {
- set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_ACCEPT);
- set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_DNAT);
- set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_SNAT);
+ if (redir->reflection && redir->_dest && redir->_src->masq)
+ {
+ set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_ACCEPT);
+ set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_DNAT);
+ set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_SNAT);
+ }
}
}
else