[v2] app/testpmd: add boundary check in flow commandline
Checks
Commit Message
There is need to add boundary for input number from commandline,
If it beyond the defination, code will return error.
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
v2:
change mask writing format.
---
app/test-pmd/cmdline_flow.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On 12/6/2018 2:38 AM, Wei Zhao wrote:
> There is need to add boundary for input number from commandline,
> If it beyond the defination, code will return error.
>
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/master, thanks.
@@ -4325,6 +4325,8 @@ parse_int(struct context *ctx, const struct token *token,
}
buf = (uint8_t *)ctx->object + arg->offset;
size = arg->size;
+ if (u > RTE_LEN2MASK(size * CHAR_BIT, uint64_t))
+ return -1;
objmask:
switch (size) {
case sizeof(uint8_t):