From bb42d8cba6e2ef432c5ba5a4a743c20209ffd144 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 28 Mar 2019 12:40:29 +0900 Subject: [PATCH] Fix calculation of maximum filename length --- repmgr-action-node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repmgr-action-node.c b/repmgr-action-node.c index 45b27c1c..71ac9a4d 100644 --- a/repmgr-action-node.c +++ b/repmgr-action-node.c @@ -2854,7 +2854,7 @@ _do_node_archive_config(void) { int filename_len = j - i; - if (filename_len > MAXPGPATH) + if (filename_len >= MAXPGPATH) filename_len = MAXPGPATH - 1; strncpy(filenamebuf, runtime_options.config_files + i, filename_len);