mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
When reallocating the node IDs array, make it bigger rather than smaller!
This commit is contained in:
parent
c206c19c19
commit
7750a1ade6
@ -1,5 +1,6 @@
|
||||
Version 2.02.34 -
|
||||
===================================
|
||||
clvmd no longer crashes if it sees nodeids over 50.
|
||||
Fix potential deadlock in clvmd thread handling.
|
||||
Refactor text format initialisation into _init_text_import.
|
||||
Escape double quotes and backslashes in external metadata and config data.
|
||||
|
@ -241,7 +241,7 @@ static void _add_up_node(const char *csid)
|
||||
|
||||
if (nodeid >= max_updown_nodes) {
|
||||
int new_size = nodeid + 10;
|
||||
int *new_updown = realloc(node_updown, new_size);
|
||||
int *new_updown = realloc(node_updown, sizeof(int) * new_size);
|
||||
|
||||
if (new_updown) {
|
||||
node_updown = new_updown;
|
||||
@ -326,7 +326,10 @@ static void get_members()
|
||||
}
|
||||
|
||||
if (node_updown == NULL) {
|
||||
size_t buf_len = sizeof(int) * max(num_nodes, max_updown_nodes);
|
||||
size_t buf_len;
|
||||
if (num_nodes > max_updown_nodes)
|
||||
max_updown_nodes = num_nodes;
|
||||
buf_len = sizeof(int) * max_updown_nodes;
|
||||
node_updown = malloc(buf_len);
|
||||
if (node_updown)
|
||||
memset(node_updown, 0, buf_len);
|
||||
|
Loading…
Reference in New Issue
Block a user