am f3d3ce5e: add bounds checking for mPartMinors[]

* commit 'f3d3ce5e53ab7928f4c292c183c417a1bd051151':
  add bounds checking for mPartMinors[]
This commit is contained in:
Nick Kralevich 2011-04-18 11:44:57 -07:00 committed by Android Git Automerger
commit aecf0e2a3d

View file

@ -186,6 +186,11 @@ void DirectVolume::handlePartitionAdded(const char *devpath, NetlinkEvent *evt)
part_num = 1;
}
if (part_num > MAX_PARTITIONS || part_num < 1) {
SLOGW("Invalid 'PARTN' value");
part_num = 1;
}
if (part_num > mDiskNumParts) {
mDiskNumParts = part_num;
}