patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] net/ring: fix unchecked return value
@ 2020-09-22 17:20 Kevin Laatz
  2020-09-23  8:06 ` [dpdk-stable] [dpdk-dev] " David Marchand
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Kevin Laatz @ 2020-09-22 17:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bruce.richardson, Kevin Laatz, stable

Add a check for the return value of the sscanf call in
parse_internal_args(), returning an error if we don't get the expected
result.

Coverity issue: 362049
Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
Cc: stable@dpdk.org

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
---
 drivers/net/ring/rte_eth_ring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 40fe1ca4ba..62060e46ce 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -539,7 +539,8 @@ parse_internal_args(const char *key __rte_unused, const char *value,
 	struct ring_internal_args **internal_args = data;
 	void *args;
 
-	sscanf(value, "%p", &args);
+	if (sscanf(value, "%p", &args) != 1)
+		return -1;
 
 	*internal_args = args;
 
-- 
2.25.1


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

end of thread, back to index

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 17:20 [dpdk-stable] [PATCH] net/ring: fix unchecked return value Kevin Laatz
2020-09-23  8:06 ` [dpdk-stable] [dpdk-dev] " David Marchand
2020-09-23  9:39   ` Bruce Richardson
2020-09-23  9:43     ` David Marchand
2020-09-23 10:04       ` Kevin Laatz
2020-09-23 10:25       ` Bruce Richardson
2020-09-25 12:43 ` [dpdk-stable] " Ferruh Yigit
2020-10-01 14:14   ` Kevin Laatz
2020-10-01 14:51     ` Ferruh Yigit
2020-10-01 17:09 ` [dpdk-stable] [PATCH v2] " Kevin Laatz
2020-10-12 11:57   ` Ferruh Yigit
2020-10-12 12:45     ` Bruce Richardson
2020-10-12 13:04       ` Ferruh Yigit
2020-10-12 13:11         ` Bruce Richardson
2020-10-13 13:07   ` [dpdk-stable] [PATCH v3] " Kevin Laatz
2020-10-13 17:23     ` Ferruh Yigit

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