[2/2] examples/pipeline: fix incorrect array out of bounds check

Message ID 20210712181833.15293-2-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] pipeline: fix incorrect resource free function |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/github-robot success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-testing fail Testing issues
ci/iol-intel-Performance fail Performance Testing issues

Commit Message

Cristian Dumitrescu July 12, 2021, 6:18 p.m. UTC
  Fix the incorrect array out of bounds check within the function
pipeline_selector_group_member_read().

Coverity issue: 371911
Fixes: 598fe0dd0d8e3 ("examples/pipeline: support selector table")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/pipeline/cli.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon July 21, 2021, 11:46 a.m. UTC | #1
12/07/2021 20:18, Cristian Dumitrescu:
> Fix the incorrect array out of bounds check within the function
> pipeline_selector_group_member_read().
> 
> Coverity issue: 371911
> Fixes: 598fe0dd0d8e3 ("examples/pipeline: support selector table")
> 
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Pathset applied, thanks.
  

Patch

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index f67783c8fa..a29be05ef4 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -1511,7 +1511,7 @@  pipeline_selector_group_member_read(const char *string,
 		if (!token || token_is_comment(token))
 			break;
 
-		if (n_tokens > GROUP_MEMBER_INFO_TOKENS_MAX)
+		if (n_tokens >= GROUP_MEMBER_INFO_TOKENS_MAX)
 			goto error;
 
 		token_array[n_tokens] = token;