Skip redirects with invalid options
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 18 Nov 2013 12:37:38 +0000 (12:37 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 18 Nov 2013 12:37:38 +0000 (12:37 +0000)
redirects.c

index ca5d4d14f082c036603ac9c48e84018f17823a81..81e93e3c34b4110726ef0f2750ba9feba8c46735 100644 (file)
@@ -247,7 +247,12 @@ fw3_load_redirects(struct fw3_state *state, struct uci_package *p)
 
                valid = false;
 
-               fw3_parse_options(redir, fw3_redirect_opts, s);
+               if (!fw3_parse_options(redir, fw3_redirect_opts, s))
+               {
+                       warn_elem(e, "skipped due to invalid options");
+                       fw3_free_redirect(redir);
+                       continue;
+               }
 
                if (!redir->enabled)
                {