From: <michaelsh@marvell.com>
To: <akhil.goyal@nxp.com>
Cc: <marko.kovacevic@intel.com>, <lironh@marvell.com>,
<michaelsh@marvell.com>, <stable@dpdk.org>
Subject: [dpdk-stable] [PATCH] examples/fips: add path length validation
Date: Sun, 2 Feb 2020 17:57:14 +0200 [thread overview]
Message-ID: <20200202155715.17079-1-michaelsh@marvell.com> (raw)
From: Michael Shamis <michaelsh@marvell.com>
Coverity CID 350345:
"copy into fixed size buffer: string overflow."
Now the length of string is validated before copy.
Cc: stable@dpdk.org
Signed-off-by: Michael Shamis <michaelsh@marvell.com>
---
examples/fips_validation/fips_validation.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index 07ffa62e9..48a92ee6d 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -257,6 +257,11 @@ fips_test_init(const char *req_file_path, const char *rsp_file_path,
fips_test_clear();
+ if (strlen(req_file_path) > MAX_STRING_SIZE) {
+ RTE_LOG(ERR, USER1, "File name %s is too long\n",
+ req_file_path);
+ return -EINVAL;
+ }
strcpy(info.file_name, req_file_path);
info.algo = FIPS_TEST_ALGO_MAX;
if (parse_file_type(req_file_path) < 0) {
--
2.24.0
reply other threads:[~2020-02-02 15:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200202155715.17079-1-michaelsh@marvell.com \
--to=michaelsh@marvell.com \
--cc=akhil.goyal@nxp.com \
--cc=lironh@marvell.com \
--cc=marko.kovacevic@intel.com \
--cc=stable@dpdk.org \
/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).