[Cluster-devel] [PATCH 2/3] libcman: fix possible string nontermination: barrier name
Jan Pokorný
jpokorny at redhat.com
Thu Oct 11 14:21:06 UTC 2012
Similar to node name case (separate changeset).
Signed-off-by: Jan Pokorný <jpokorny at 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
More information about the Cluster-devel
mailing list