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:
45eb6a1
)
examples/pipeline: fix CLI parsing crash
author
Cristian Dumitrescu
<cristian.dumitrescu@intel.com>
Thu, 28 Jan 2021 19:12:39 +0000
(19:12 +0000)
committer
Thomas Monjalon
<thomas@monjalon.net>
Fri, 29 Jan 2021 15:20:58 +0000
(16:20 +0100)
Cannot dereference pointer for token[1] unless valid.
Fixes:
5074e1d551
("examples/pipeline: add configuration commands")
Cc: stable@dpdk.org
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
examples/pipeline/cli.c
patch
|
blob
|
history
diff --git
a/examples/pipeline/cli.c
b/examples/pipeline/cli.c
index
d0150cf
..
e97e120
100644
(file)
--- a/
examples/pipeline/cli.c
+++ b/
examples/pipeline/cli.c
@@
-1294,7
+1294,7
@@
cli_process(char *in, char *out, size_t out_size, void *obj)
}
if (strcmp(tokens[0], "link") == 0) {
- if (
strcmp(tokens[1], "show") == 0
) {
+ if (
(n_tokens >= 2) && (strcmp(tokens[1], "show") == 0)
) {
cmd_link_show(tokens, n_tokens, out, out_size, obj);
return;
}