git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97cb804
)
app/testpmd: add boundary check in flow command
author
Wei Zhao
<wei.zhao1@intel.com>
Thu, 6 Dec 2018 02:38:06 +0000
(10:38 +0800)
committer
Ferruh Yigit
<ferruh.yigit@intel.com>
Fri, 21 Dec 2018 15:22:41 +0000
(16:22 +0100)
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 <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/cmdline_flow.c
patch
|
blob
|
history
diff --git
a/app/test-pmd/cmdline_flow.c
b/app/test-pmd/cmdline_flow.c
index
5c0108f
..
659908f
100644
(file)
--- 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):