summaryrefslogtreecommitdiffstats
path: root/src/expr/byteorder.c
diff options
context:
space:
mode:
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);