[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 2/3] libcman: fix possible string nontermination: barrier name



Similar to node name case (separate changeset).

Signed-off-by: Jan Pokorný <jpokorny redhat com>
---
 cman/lib/libcman.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cman/lib/libcman.c b/cman/lib/libcman.c
index 012047d..f27e726 100644
--- a/cman/lib/libcman.c
+++ b/cman/lib/libcman.c
@@ -912,7 +912,7 @@ int cman_barrier_register(cman_handle_t handle, const char *name, int flags, int
 	}
 
 	binfo.cmd = BARRIER_CMD_REGISTER;
-	strncpy(binfo.name, name, sizeof(binfo.name) - 1);
+	strncpy(binfo.name, name, sizeof(binfo.name));
 	binfo.arg = nodes;
 	binfo.flags = flags;
 
@@ -933,7 +933,7 @@ int cman_barrier_change(cman_handle_t handle, const char *name, int flags, int a
 	}
 
 	binfo.cmd = BARRIER_CMD_CHANGE;
-	strncpy(binfo.name, name, sizeof(binfo.name) - 1);
+	strncpy(binfo.name, name, sizeof(binfo.name));
 	binfo.arg = arg;
 	binfo.flags = flags;
 
@@ -954,7 +954,7 @@ int cman_barrier_wait(cman_handle_t handle, const char *name)
 	}
 
 	binfo.cmd = BARRIER_CMD_WAIT;
-	strncpy(binfo.name, name, sizeof(binfo.name) - 1);
+	strncpy(binfo.name, name, sizeof(binfo.name));
 
 	return info_call(h, CMAN_CMD_BARRIER, &binfo, sizeof(binfo), NULL, 0);
 }
@@ -972,7 +972,7 @@ int cman_barrier_delete(cman_handle_t handle, const char *name)
 	}
 
 	binfo.cmd = BARRIER_CMD_DELETE;
-	strncpy(binfo.name, name, sizeof(binfo.name) - 1);
+	strncpy(binfo.name, name, sizeof(binfo.name));
 
 	return info_call(h, CMAN_CMD_BARRIER, &binfo, sizeof(binfo), NULL, 0);
 }
-- 
1.7.11.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]