1 Star 0 Fork 16

bixiaoyan/fence-agents

forked from src-openEuler/fence-agents 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fence_kdump-fix-strncpy-issue.patch 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
liqiuyu 提交于 2020-11-20 11:45 . Resolve agent redfish compilation fail
From ac83d8ce3d8dd868b0e887528e7c269cee4dcac8 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <[email protected]>
Date: Tue, 31 Jul 2018 15:57:38 +0200
Subject: [PATCH] fence_kdump: fix strncpy issue
---
agents/kdump/fence_kdump.c | 2 +-
agents/kdump/fence_kdump_send.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/agents/kdump/fence_kdump.c b/agents/kdump/fence_kdump.c
index e2f3cd80..768a9344 100644
--- a/agents/kdump/fence_kdump.c
+++ b/agents/kdump/fence_kdump.c
@@ -351,7 +351,7 @@ get_options_node (fence_kdump_opts_t *opts)
hints.ai_protocol = IPPROTO_UDP;
hints.ai_flags = AI_NUMERICSERV;
- strncpy (node->name, opts->nodename, sizeof (node->name));
+ strncpy (node->name, opts->nodename, sizeof (node->name) - 1);
snprintf (node->port, sizeof (node->port), "%d", opts->ipport);
node->info = NULL;
diff --git a/agents/kdump/fence_kdump_send.c b/agents/kdump/fence_kdump_send.c
index d668bed3..638f8c97 100644
--- a/agents/kdump/fence_kdump_send.c
+++ b/agents/kdump/fence_kdump_send.c
@@ -116,7 +116,7 @@ get_options_node (fence_kdump_opts_t *opts)
hints.ai_protocol = IPPROTO_UDP;
hints.ai_flags = AI_NUMERICSERV;
- strncpy (node->name, opts->nodename, sizeof (node->name));
+ strncpy (node->name, opts->nodename, sizeof (node->name) - 1);
snprintf (node->port, sizeof (node->port), "%d", opts->ipport);
node->info = NULL;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bixiaoyan1/fence-agents.git
[email protected]:bixiaoyan1/fence-agents.git
bixiaoyan1
fence-agents
fence-agents
master

搜索帮助