android: prevent imported archive from being written outside the export folder (#7375)

This commit is contained in:
spaced4ndy
2026-08-17 10:59:03 +00:00
committed by GitHub
parent 68916aa90a
commit 3b1e5abcbc
3 changed files with 8 additions and 2 deletions
@@ -233,7 +233,8 @@ actual fun getFileName(uri: URI): String? {
val nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)
cursor.moveToFirst()
// Can make an exception
cursor.getString(nameIndex)
// the provider controls this value, and callers use it as a bare file name
cursor.getString(nameIndex)?.let { File(it).name }
}
} catch (e: Exception) {
null