Merge "Added extra validation for invalid paths." into nyc-dev

am: 40297c1a9c

* commit '40297c1a9ce076797d2576e96fbd2f0d76eef1d5':
  Added extra validation for invalid paths.

Change-Id: Ic0bfe4e1aa967b7b3b4a8a4c32dcb85813f9c551
This commit is contained in:
Felipe Leme
2016-04-19 02:14:48 +00:00
committed by android-build-merger

View File

@@ -212,6 +212,12 @@ public class OpenExternalDirectoryActivity extends Activity {
break;
}
}
if (internalRoot == null) {
// Should not happen on normal circumstances, unless app crafted an invalid volume
// using reflection or the list of mounted volumes changed.
Log.e(TAG, "Didn't find right volume for '" + storageVolume.dump() + "' on " + volumes);
return false;
}
// Checks if the user has granted the permission already.
final Intent intent = getIntentForExistingPermission(activity, isRoot, internalRoot, file);