Commit a10e9de4 by krocard Committed by kim-vde

Check that cache dir exist

Not checking it would force ExoPlayer to use the
global tmp dir which would expose it to
external file replacement attacks.

This is a theoretical vulnerability as this code is
only use in tests and cache dir always exist in the
AOSP android implementation.

PiperOrigin-RevId: 353013929
parent d1faf713
......@@ -2084,7 +2084,7 @@ public final class Util {
/** Creates a new empty file in the directory returned by {@link Context#getCacheDir()}. */
public static File createTempFile(Context context, String prefix) throws IOException {
return File.createTempFile(prefix, null, context.getCacheDir());
return File.createTempFile(prefix, null, checkNotNull(context.getCacheDir()));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment