netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/5] iptables: bugfix - prevent wrong syntax being accepted by the set match
@ 2013-06-29 21:32 Dash Four
  0 siblings, 0 replies; only message in thread
From: Dash Four @ 2013-06-29 21:32 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: Pablo Neira Ayuso, Netfilter Core Team

This patch corrects a bug, which was allowing wrong src and dst syntax to be
specified and accepted by the set match.

v1 * initial revision

Signed-off-by: Dash Four <mr.dash.four@googlemail.com>
---
  extensions/libxt_set.h | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/extensions/libxt_set.h b/extensions/libxt_set.h
index 47c3f5b..a352ac3 100644
--- a/extensions/libxt_set.h
+++ b/extensions/libxt_set.h
@@ -109,9 +109,9 @@ parse_dirs_v0(const char *opt_arg, struct xt_set_info_v0 *info)
  	
  	while (i < (IPSET_DIM_MAX - 1) && tmp != NULL) {
  		ptr = strsep(&tmp, ",");
-		if (strncmp(ptr, "src", 3) == 0)
+		if (strncmp(ptr, "src", 4) == 0)
  			info->u.flags[i++] |= IPSET_SRC;
-		else if (strncmp(ptr, "dst", 3) == 0)
+		else if (strncmp(ptr, "dst", 4) == 0)
  			info->u.flags[i++] |= IPSET_DST;
  		else
  			xtables_error(PARAMETER_PROBLEM,
@@ -135,9 +135,9 @@ parse_dirs(const char *opt_arg, struct xt_set_info *info)
  	while (info->dim < IPSET_DIM_MAX && tmp != NULL) {
  		info->dim++;
  		ptr = strsep(&tmp, ",");
-		if (strncmp(ptr, "src", 3) == 0)
+		if (strncmp(ptr, "src", 4) == 0)
  			info->flags |= (1 << info->dim);
-		else if (strncmp(ptr, "dst", 3) != 0)
+		else if (strncmp(ptr, "dst", 4) != 0)
  			xtables_error(PARAMETER_PROBLEM,
  				"You must spefify (the comma separated list of) 'src' or 'dst'.");
  	}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-29 21:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-29 21:32 [PATCH v3 1/5] iptables: bugfix - prevent wrong syntax being accepted by the set match Dash Four

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).