提交 f61b428f 编写于 作者: C Chih-Wei Huang

Merge tag 'android-5.1.1_r38' into multiwindow

Android 5.1.1 release 38
......@@ -1230,9 +1230,15 @@ public final class DownloadProvider extends ContentProvider {
throw new FileNotFoundException("No filename found.");
}
final File file = new File(path);
final File file;
try {
file = new File(path).getCanonicalFile();
} catch (IOException e) {
throw new FileNotFoundException(e.getMessage());
}
if (!Helpers.isFilenameValid(getContext(), file)) {
throw new FileNotFoundException("Invalid file: " + file);
throw new FileNotFoundException("Invalid file path: " + file);
}
final int pfdMode = ParcelFileDescriptor.parseMode(mode);
......
......@@ -341,7 +341,6 @@ public class Helpers {
static boolean isFilenameValid(Context context, File file) {
final File[] whitelist;
try {
file = file.getCanonicalFile();
whitelist = new File[] {
context.getFilesDir().getCanonicalFile(),
context.getCacheDir().getCanonicalFile(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册