DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/pipeline: fix CLI segfault
@ 2021-01-28 19:12 Cristian Dumitrescu
  2021-01-29 15:01 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Cristian Dumitrescu @ 2021-01-28 19:12 UTC (permalink / raw)
  To: dev; +Cc: stable

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 3f490854c..cacfb2823 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -1420,7 +1420,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;
 		}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/pipeline: fix CLI segfault
  2021-01-28 19:12 [dpdk-dev] [PATCH] examples/pipeline: fix CLI segfault Cristian Dumitrescu
@ 2021-01-29 15:01 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2021-01-29 15:01 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, stable

28/01/2021 20:12, Cristian Dumitrescu:
> 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>

Applied, thanks



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-29 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 19:12 [dpdk-dev] [PATCH] examples/pipeline: fix CLI segfault Cristian Dumitrescu
2021-01-29 15:01 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).