From: Wei Zhao Date: Thu, 6 Dec 2018 02:38:06 +0000 (+0800) Subject: app/testpmd: add boundary check in flow command X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ef1202d188ef97586c880e113843e19340a73642;p=dpdk.git app/testpmd: add boundary check in flow command There is need to add boundary for input number from commandline, If it beyond the definition, code will return error. Signed-off-by: Wei Zhao Reviewed-by: Ferruh Yigit --- diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 5c0108fa70..659908fcf1 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -4327,6 +4327,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):