patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] app/test-fib: fix unchecked return value
@ 2020-05-11  9:22 Vladimir Medvedkin
  2020-05-19 17:45 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Medvedkin @ 2020-05-11  9:22 UTC (permalink / raw)
  To: dev; +Cc: stable

Check returned value after strtok()
CID 355674 (#1 of 1): Dereference null return value (NULL_RETURNS)
4. dereference: Dereferencing a pointer that might be NULL s when
calling inet_pton

Fixes: 103809d032cd ("app/test-fib: add test application for FIB")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 app/test-fib/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-fib/main.c b/app/test-fib/main.c
index 6e80d65..9cf01b1 100644
--- a/app/test-fib/main.c
+++ b/app/test-fib/main.c
@@ -543,6 +543,8 @@ parse_lookup(FILE *f, int af)
 
 	while (fgets(line, sizeof(line), f) != NULL) {
 		s = strtok(line, " \t\n");
+		if (s == NULL)
+			return -EINVAL;
 		ret = inet_pton(af, s, &tbl[i]);
 		if (ret != 1)
 			return -EINVAL;
-- 
2.7.4


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

* Re: [dpdk-stable] [PATCH] app/test-fib: fix unchecked return value
  2020-05-11  9:22 [dpdk-stable] [PATCH] app/test-fib: fix unchecked return value Vladimir Medvedkin
@ 2020-05-19 17:45 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2020-05-19 17:45 UTC (permalink / raw)
  To: Vladimir Medvedkin; +Cc: dev, stable

11/05/2020 11:22, Vladimir Medvedkin:
> Check returned value after strtok()
> CID 355674 (#1 of 1): Dereference null return value (NULL_RETURNS)
> 4. dereference: Dereferencing a pointer that might be NULL s when
> calling inet_pton
> 
> Fixes: 103809d032cd ("app/test-fib: add test application for FIB")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

Applied, thanks




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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11  9:22 [dpdk-stable] [PATCH] app/test-fib: fix unchecked return value Vladimir Medvedkin
2020-05-19 17:45 ` Thomas Monjalon

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/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 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


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