1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Fix another allocation bug with clvmd and large node IDs.`

This commit is contained in:
Christine Caulfield 2008-04-01 15:01:30 +00:00
parent 9332d2cb9d
commit 611c0689fc
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.34 -
===================================
Fix another allocation bug with clvmd and large node IDs.
Add find_lv_in_lv_list() and find_pv_in_pv_list().
Fix uninitialised variable in clvmd that could cause odd hangs.
Add vgmerge tests.

View File

@ -297,6 +297,8 @@ static void get_members()
{
int retnodes;
int status;
int i;
int high_nodeid = 0;
num_nodes = cman_get_node_count(c_handle);
if (num_nodes == -1) {
@ -325,10 +327,16 @@ static void get_members()
exit(6);
}
/* Get the highest nodeid */
for (i=0; i<retnodes; i++) {
if (nodes[i].cn_nodeid > high_nodeid)
high_nodeid = nodes[i].cn_nodeid;
}
if (node_updown == NULL) {
size_t buf_len;
if (num_nodes > max_updown_nodes)
max_updown_nodes = num_nodes;
if (high_nodeid >= max_updown_nodes)
max_updown_nodes = high_nodeid + 1;
buf_len = sizeof(int) * max_updown_nodes;
node_updown = malloc(buf_len);
if (node_updown)