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

[radix-tree] Fix bug in _degrade_to_n16

Values were getting shuffled
This commit is contained in:
Joe Thornber 2018-09-20 14:20:16 +01:00
parent 0ac7913c6a
commit ebd2d7773f

View File

@ -581,12 +581,11 @@ static void _degrade_to_n16(struct node48 *n48, struct value *result)
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
if (n48->keys[i] < 48) { if (n48->keys[i] < 48) {
n16->keys[count] = i; n16->keys[count] = i;
n16->values[count] = n48->values[n48->keys[i]];
count++; count++;
} }
} }
memcpy(n16->values, n48->values, n48->nr_entries * sizeof(*n16->values));
free(n48); free(n48);
result->type = NODE16; result->type = NODE16;