summaryrefslogtreecommitdiffstats
path: root/DirectVolume.cpp
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2011-04-18 11:16:13 -0700
committerNick Kralevich <nnk@google.com>2011-04-18 11:16:13 -0700
commitf3d3ce5e53ab7928f4c292c183c417a1bd051151 (patch)
treeae9d413e16c8fee8354bb31d97490642597a2f90 /DirectVolume.cpp
parenta28056b38275003895ff5d9576681aca01544822 (diff)
downloadsystem_vold-f3d3ce5e53ab7928f4c292c183c417a1bd051151.tar.gz
system_vold-f3d3ce5e53ab7928f4c292c183c417a1bd051151.tar.bz2
system_vold-f3d3ce5e53ab7928f4c292c183c417a1bd051151.zip
add bounds checking for mPartMinors[]
Change-Id: I6d5b26756c8434d6396f3535252608ce61eabfd8
Diffstat (limited to 'DirectVolume.cpp')
-rw-r--r--DirectVolume.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/DirectVolume.cpp b/DirectVolume.cpp
index ce5b892..0ac1a0c 100644
--- a/DirectVolume.cpp
+++ b/DirectVolume.cpp
@@ -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;
}