|
|
21d5fd |
From ac83d8ce3d8dd868b0e887528e7c269cee4dcac8 Mon Sep 17 00:00:00 2001
|
|
|
21d5fd |
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
|
|
21d5fd |
Date: Tue, 31 Jul 2018 15:57:38 +0200
|
|
|
21d5fd |
Subject: [PATCH] fence_kdump: fix strncpy issue
|
|
|
21d5fd |
|
|
|
21d5fd |
---
|
|
|
21d5fd |
agents/kdump/fence_kdump.c | 2 +-
|
|
|
21d5fd |
agents/kdump/fence_kdump_send.c | 2 +-
|
|
|
21d5fd |
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
21d5fd |
|
|
|
21d5fd |
diff --git a/agents/kdump/fence_kdump.c b/agents/kdump/fence_kdump.c
|
|
|
21d5fd |
index e2f3cd80..768a9344 100644
|
|
|
21d5fd |
--- a/agents/kdump/fence_kdump.c
|
|
|
21d5fd |
+++ b/agents/kdump/fence_kdump.c
|
|
|
21d5fd |
@@ -351,7 +351,7 @@ get_options_node (fence_kdump_opts_t *opts)
|
|
|
21d5fd |
hints.ai_protocol = IPPROTO_UDP;
|
|
|
21d5fd |
hints.ai_flags = AI_NUMERICSERV;
|
|
|
21d5fd |
|
|
|
21d5fd |
- strncpy (node->name, opts->nodename, sizeof (node->name));
|
|
|
21d5fd |
+ strncpy (node->name, opts->nodename, sizeof (node->name) - 1);
|
|
|
21d5fd |
snprintf (node->port, sizeof (node->port), "%d", opts->ipport);
|
|
|
21d5fd |
|
|
|
21d5fd |
node->info = NULL;
|
|
|
21d5fd |
diff --git a/agents/kdump/fence_kdump_send.c b/agents/kdump/fence_kdump_send.c
|
|
|
21d5fd |
index d668bed3..638f8c97 100644
|
|
|
21d5fd |
--- a/agents/kdump/fence_kdump_send.c
|
|
|
21d5fd |
+++ b/agents/kdump/fence_kdump_send.c
|
|
|
21d5fd |
@@ -116,7 +116,7 @@ get_options_node (fence_kdump_opts_t *opts)
|
|
|
21d5fd |
hints.ai_protocol = IPPROTO_UDP;
|
|
|
21d5fd |
hints.ai_flags = AI_NUMERICSERV;
|
|
|
21d5fd |
|
|
|
21d5fd |
- strncpy (node->name, opts->nodename, sizeof (node->name));
|
|
|
21d5fd |
+ strncpy (node->name, opts->nodename, sizeof (node->name) - 1);
|
|
|
21d5fd |
snprintf (node->port, sizeof (node->port), "%d", opts->ipport);
|
|
|
21d5fd |
|
|
|
21d5fd |
node->info = NULL;
|