代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 585eeea3522ce2225a1df94fcc0b8aec2d881b44 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <[email protected]>
Date: Fri, 21 Oct 2022 15:37:03 +0800
Subject: [PATCH 187/189] telemetry: limit command characters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Limit the telemetry command characters to the minimum set needed for
current implementations. This prevents issues with invalid json
characters needing to be escaped on replies.
Signed-off-by: Bruce Richardson <[email protected]>
Acked-by: Ciara Power <[email protected]>
Acked-by: Morten Brørup <[email protected]>
Acked-by: Chengwen Feng <[email protected]>
---
lib/telemetry/telemetry.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index d4a7838ded..f0be50b2bf 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -3,6 +3,7 @@
*/
#ifndef RTE_EXEC_ENV_WINDOWS
+#include <ctype.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/socket.h>
@@ -71,12 +72,19 @@ int
rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help)
{
struct cmd_callback *new_callbacks;
+ const char *cmdp = cmd;
int i = 0;
if (strlen(cmd) >= MAX_CMD_LEN || fn == NULL || cmd[0] != '/'
|| strlen(help) >= RTE_TEL_MAX_STRING_LEN)
return -EINVAL;
+ while (*cmdp != '\0') {
+ if (!isalnum(*cmdp) && *cmdp != '_' && *cmdp != '/')
+ return -EINVAL;
+ cmdp++;
+ }
+
rte_spinlock_lock(&callback_sl);
new_callbacks = realloc(callbacks, sizeof(callbacks[0]) * (num_callbacks + 1));
if (new_callbacks == NULL) {
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。