DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chengwen Feng <fengchengwen@huawei.com>
To: <thomas@monjalon.net>
Cc: <dev@dpdk.org>, <cristian.dumitrescu@intel.com>
Subject: [PATCH 1/4] cfgfile: remove dead code
Date: Tue, 20 Feb 2024 03:58:37 +0000	[thread overview]
Message-ID: <20240220035840.32978-2-fengchengwen@huawei.com> (raw)
In-Reply-To: <20240220035840.32978-1-fengchengwen@huawei.com>

This memchr() will never return NULL because rte_cfgfile_load() function
will skip lines without useful content.

Fixes: 74e0d3a17461 ("cfgfile: fix null pointer dereference in parsing")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/cfgfile/rte_cfgfile.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c
index 6a5e4fd942..d7aa38b56f 100644
--- a/lib/cfgfile/rte_cfgfile.c
+++ b/lib/cfgfile/rte_cfgfile.c
@@ -223,12 +223,6 @@ rte_cfgfile_load_with_params(const char *filename, int flags,
 
 			split[0] = buffer;
 			split[1] = memchr(buffer, '=', len);
-			if (split[1] == NULL) {
-				CFG_LOG(ERR,
-					"line %d - no '=' character found",
-					lineno);
-				goto error1;
-			}
 			*split[1] = '\0';
 			split[1]++;
 
-- 
2.17.1


  reply	other threads:[~2024-02-20  4:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  3:58 [PATCH 0/4] cfgfile: enhance error detecting Chengwen Feng
2024-02-20  3:58 ` Chengwen Feng [this message]
2024-02-20  3:58 ` [PATCH 2/4] cfgfile: support verify name and value Chengwen Feng
2024-02-20  3:58 ` [PATCH 3/4] cfgfile: verify add section and entry result Chengwen Feng
2024-02-20  3:58 ` [PATCH 4/4] cfgfile: add unique name flag Chengwen Feng

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20240220035840.32978-2-fengchengwen@huawei.com \
    --to=fengchengwen@huawei.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).