summaryrefslogtreecommitdiffstats
path: root/src/expr/byteorder.c
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>2013-06-26 13:37:02 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-06-27 19:11:11 +0200
commit783a972f6acd680bed92fac36c5388d15620e754 (patch)
tree1a95b955f5f83f84711c9dec39cee2ac6d251308 /src/expr/byteorder.c
parent34caf0add23aab075c2bbe1a99927c081014cadd (diff)
expr: xml: registers must be <= NFT_REG_MAX
With this patch, all expressions validate that registers are <= NFT_REG_MAX. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr/byteorder.c')
-rw-r--r--src/expr/byteorder.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c
index 201a943..c2f38a8 100644
--- a/src/expr/byteorder.c
+++ b/src/expr/byteorder.c
@@ -225,6 +225,9 @@ nft_rule_expr_byteorder_xml_parse(struct nft_rule_expr *e, char *xml)
if (tmp > UINT32_MAX || tmp < 0 || *endptr)
goto err;
+ if (tmp > NFT_REG_MAX)
+ goto err;
+
byteorder->sreg = tmp;
e->flags |= (1 << NFT_EXPR_BYTEORDER_SREG);
@@ -236,6 +239,9 @@ nft_rule_expr_byteorder_xml_parse(struct nft_rule_expr *e, char *xml)
if (tmp > UINT32_MAX || tmp < 0 || *endptr)
goto err;
+ if (tmp > NFT_REG_MAX)
+ goto err;
+
byteorder->dreg = tmp;
e->flags |= (1 << NFT_EXPR_BYTEORDER_DREG);