diff options
author | Pat Erley <perley@cyngn.com> | 2016-02-23 15:37:33 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-02-23 17:49:05 -0800 |
commit | d347973ab6d395ae6665a733a55846f37c593c17 (patch) | |
tree | e80b70b0071528f7ecb9242897ff238cf580b133 | |
parent | 9028e659877517589382d30753597f5ab0f06022 (diff) | |
download | frameworks_base-d347973ab6d395ae6665a733a55846f37c593c17.zip frameworks_base-d347973ab6d395ae6665a733a55846f37c593c17.tar.gz frameworks_base-d347973ab6d395ae6665a733a55846f37c593c17.tar.bz2 |
SharedStorageAgent: fix off by 1
The index into an array should never be equal to the number of
elements in that array.
Change-Id: I37161778467a849fea7e04d7067d919a7c296ad3
-rw-r--r-- | packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java b/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java index e453cf5..2cd1f29 100644 --- a/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java +++ b/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/SharedStorageAgent.java @@ -76,7 +76,7 @@ public class SharedStorageAgent extends FullBackupAgent { if (slash > 0) { try { int i = Integer.parseInt(relpath.substring(0, slash)); - if (i <= mVolumes.length) { + if (i < mVolumes.length) { outFile = new File(mVolumes[i].getPath(), relpath.substring(slash + 1)); if (DEBUG) Slog.i(TAG, " => " + outFile.getAbsolutePath()); } else { |