From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
To: dev@dpdk.org
Cc: gakhil@marvell.com, brian.dooley@intel.com,
Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>,
stable@dpdk.org
Subject: [PATCH v2] common/qat: fix incorrect size in the parser
Date: Tue, 11 Mar 2025 10:30:24 +0000 [thread overview]
Message-ID: <20250311103024.1186285-1-arkadiuszx.kusztal@intel.com> (raw)
The function `strlen` returns the size of the string without a terminating
null-character, therefore a request to allocate memory space for a parsed
argument is too small by 1.
Fixes: 99ab2806687b ("common/qat: isolate parser arguments configuration")
Cc: stable@dpdk.org
Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
---
v2:
- changed the placement of `len` incrementation
drivers/common/qat/qat_device.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index bca88fd9bd..b582e3bf8b 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -229,6 +229,7 @@ qat_dev_parse_command_line(struct qat_pci_device *qat_dev,
len = strlen(devargs->drv_str);
if (len == 0)
return 0;
+ ++len;
/* Allocate per-device command line */
qat_dev->command_line = rte_malloc(NULL, len, 0);
if (qat_dev->command_line == NULL) {
--
2.43.0
reply other threads:[~2025-03-11 10:30 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=20250311103024.1186285-1-arkadiuszx.kusztal@intel.com \
--to=arkadiuszx.kusztal@intel.com \
--cc=brian.dooley@intel.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.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).