Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion block/partitions/aix.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,14 @@ int aix_partition(struct parsed_partitions *state)
if (n) {
int foundlvs = 0;

for (i = 0; foundlvs < numlvs && i < state->limit; i += 1) {
/*
* The lvd array was read as a single sector; only the
* struct lvd entries that fit in it are valid. Bound the
* scan so an on-disk numlvs larger than that cannot walk
* the read buffer out of bounds.
*/
for (i = 0; foundlvs < numlvs && i < state->limit &&
i < 512 / (int)sizeof(struct lvd); i += 1) {
lvip[i].pps_per_lv = be16_to_cpu(p[i].num_lps);
if (lvip[i].pps_per_lv)
foundlvs += 1;
Expand Down
Loading