patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Vladimir Medvedkin <>
Subject: [dpdk-stable] [PATCH] app/test-fib: fix unchecked return value
Date: Mon, 11 May 2020 10:22:32 +0100
Message-ID: <> (raw)

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")

Signed-off-by: Vladimir Medvedkin <>
 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;

             reply	other threads:[~2020-05-11  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11  9:22 Vladimir Medvedkin [this message]
2020-05-19 17:45 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror 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/ \
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone