Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d347973a authored by Pat Erley's avatar Pat Erley Committed by Gerrit Code Review
Browse files

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
parent 9028e659
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 {