patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] telemetry: fix potential connection issue
@ 2024-06-21  2:40 Zhichao Zeng
  2024-06-26  2:13 ` Jiale, SongX
  0 siblings, 1 reply; 2+ messages in thread
From: Zhichao Zeng @ 2024-06-21  2:40 UTC (permalink / raw)
  To: dev; +Cc: stable, Zhichao Zeng, Bruce Richardson, Keith Wiles, Ciara Power

For calling memcpy when the source and destination addresses are the same,
there is a small probability that there will be a copy error issue in some
environments, resulting in a failure to connect.

This patch uses memmove instead of memcpy to avoid this issue.

Fixes: b80fe1805eee ("telemetry: introduce backward compatibility")
Cc: stable@dpdk.org

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 lib/telemetry/telemetry_legacy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/telemetry/telemetry_legacy.c b/lib/telemetry/telemetry_legacy.c
index 4c1d1c353a..578230732c 100644
--- a/lib/telemetry/telemetry_legacy.c
+++ b/lib/telemetry/telemetry_legacy.c
@@ -94,7 +94,7 @@ register_client(const char *cmd __rte_unused, const char *params,
 	}
 #ifndef RTE_EXEC_ENV_WINDOWS
 	strlcpy(data, strchr(params, ':'), sizeof(data));
-	memcpy(data, &data[strlen(":\"")], strlen(data));
+	memmove(data, &data[strlen(":\"")], strlen(data));
 	if (!strchr(data, '\"')) {
 		fprintf(stderr, "Invalid client data\n");
 		return -1;
-- 
2.34.1


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

end of thread, other threads:[~2024-06-26  2:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-21  2:40 [PATCH] telemetry: fix potential connection issue Zhichao Zeng
2024-06-26  2:13 ` Jiale, SongX

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