diff options
author | Bruce Beare <brucex.j.beare@intel.com> | 2010-07-22 13:23:33 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2011-06-09 17:39:19 +0200 |
commit | d11b833201ae72265d52d606fa084841b44e9a65 (patch) | |
tree | 4a02ce01d70e45634ff55d496ed8d39364ee8eb2 | |
parent | c51920c82463b240e2be0430849837d6fdc5352e (diff) | |
download | system_vold-d11b833201ae72265d52d606fa084841b44e9a65.tar.gz system_vold-d11b833201ae72265d52d606fa084841b44e9a65.tar.bz2 system_vold-d11b833201ae72265d52d606fa084841b44e9a65.zip |
Avoid array overrun. We can now mount the /sdcard partition on our boot sdcards
Orig-Change-Id: I6e9db8c55db49b4aa61dd40cd59495f55e5b3368
Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
-rw-r--r-- | DirectVolume.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/DirectVolume.cpp b/DirectVolume.cpp index 0ac1a0c..a570a73 100644 --- a/DirectVolume.cpp +++ b/DirectVolume.cpp @@ -202,9 +202,13 @@ void DirectVolume::handlePartitionAdded(const char *devpath, NetlinkEvent *evt) #ifdef PARTITION_DEBUG SLOGD("Dv:partAdd: part_num = %d, minor = %d\n", part_num, minor); #endif - mPartMinors[part_num -1] = minor; - + if (part_num >= MAX_PARTITIONS) { + SLOGE("Dv:partAdd: ignoring part_num = %d (max: %d)\n", part_num, MAX_PARTITIONS-1); + } else { + mPartMinors[part_num -1] = minor; + } mPendingPartMap &= ~(1 << part_num); + if (!mPendingPartMap) { #ifdef PARTITION_DEBUG SLOGD("Dv:partAdd: Got all partitions - ready to rock!"); |