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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git