1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

allocation: Avoid exceeding array bounds in allocation tag code

If _limit_to_one_area_per_tag() changes nothing it writes beyond
the array.
This commit is contained in:
Alasdair G Kergon 2018-01-10 02:03:32 +00:00
parent e2438b5b9f
commit bacc942333
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.178 -
=====================================
Avoid exceeding array bounds in allocation tag processing.
Refactor metadata reading code to use callback functions.
Move memory allocation for the key dev_reads into the device layer.

View File

@ -2737,7 +2737,8 @@ static int _limit_to_one_area_per_tag(struct alloc_handle *ah, struct alloc_stat
s++;
}
alloc_state->areas[u].pva = NULL;
if (u < alloc_state->areas_size)
alloc_state->areas[u].pva = NULL;
return 1;
}