diff options
| author | Po Lu | 2024-07-11 11:40:34 +0800 |
|---|---|---|
| committer | Po Lu | 2024-07-11 11:40:34 +0800 |
| commit | 166685a7d9568cc8fcbc2ad85db1ed23efd9793e (patch) | |
| tree | 7c597d10febfa77c577c0f68efe835e866038d63 /java | |
| parent | 29aeed7218c77180eef8afac6056af103069b4b2 (diff) | |
| parent | e0b271e279ba5b606330908604ac4fa42a389b30 (diff) | |
| download | emacs-166685a7d9568cc8fcbc2ad85db1ed23efd9793e.tar.gz emacs-166685a7d9568cc8fcbc2ad85db1ed23efd9793e.zip | |
Merge from savannah/emacs-30
e0b271e279b Take precautions against ill-formed content URIs
9331ab056a4 etags-regen-mode: Handle TAGS buffer being killed
ef3f26ec02d ; Tag ERC multiline blanks test as :expensive
945335fec1e Improve 'put-image' documentation
c38d5cc3b28 Improve 'set-fontset-font' documentation
7de4dbea08f Adapt Tramp's "run0" method
871585db4ca * test/src/sqlite-tests.el (sqlite-execute-batch): Declar...
5cf8d60e0de Capitalize "Dired" and "Lisp" in docstrings
37475c9af7a Document Eshell entry points
# Conflicts:
# etc/NEWS
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsService.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 77124a7d80f..7afe4c7f82e 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java | |||
| @@ -987,6 +987,7 @@ public final class EmacsService extends Service | |||
| 987 | String name, mode; | 987 | String name, mode; |
| 988 | ParcelFileDescriptor fd; | 988 | ParcelFileDescriptor fd; |
| 989 | int i; | 989 | int i; |
| 990 | Uri uriObject; | ||
| 990 | 991 | ||
| 991 | /* Figure out the file access mode. */ | 992 | /* Figure out the file access mode. */ |
| 992 | 993 | ||
| @@ -1001,12 +1002,20 @@ public final class EmacsService extends Service | |||
| 1001 | if (truncate) | 1002 | if (truncate) |
| 1002 | mode += "t"; | 1003 | mode += "t"; |
| 1003 | 1004 | ||
| 1005 | /* Decode the URI. It might be possible for a perverse user to | ||
| 1006 | construct a content file name that Android finds unparsable, so | ||
| 1007 | punt if the result is NULL. */ | ||
| 1008 | |||
| 1009 | uriObject = Uri.parse (uri); | ||
| 1010 | if (uriObject == null) | ||
| 1011 | return -1; | ||
| 1012 | |||
| 1004 | /* Try to open a corresponding ParcelFileDescriptor. Though | 1013 | /* Try to open a corresponding ParcelFileDescriptor. Though |
| 1005 | `fd.detachFd' is exclusive to Honeycomb and up, this function is | 1014 | `fd.detachFd' is exclusive to Honeycomb and up, this function is |
| 1006 | never called on systems older than KitKat, which is Emacs's | 1015 | never called on systems older than KitKat, which is Emacs's |
| 1007 | minimum requirement for access to /content/by-authority. */ | 1016 | minimum requirement for access to /content/by-authority. */ |
| 1008 | 1017 | ||
| 1009 | fd = resolver.openFileDescriptor (Uri.parse (uri), mode); | 1018 | fd = resolver.openFileDescriptor (uriObject, mode); |
| 1010 | if (fd == null) | 1019 | if (fd == null) |
| 1011 | return -1; | 1020 | return -1; |
| 1012 | 1021 | ||
| @@ -1027,7 +1036,14 @@ public final class EmacsService extends Service | |||
| 1027 | Uri uri; | 1036 | Uri uri; |
| 1028 | int rc, flags; | 1037 | int rc, flags; |
| 1029 | 1038 | ||
| 1039 | /* Decode the URI. It might be possible that perverse user should | ||
| 1040 | construct a content file name that Android finds unparsable, so | ||
| 1041 | punt if the result is NULL. */ | ||
| 1042 | |||
| 1030 | uri = Uri.parse (name); | 1043 | uri = Uri.parse (name); |
| 1044 | if (uri == null) | ||
| 1045 | return false; | ||
| 1046 | |||
| 1031 | flags = 0; | 1047 | flags = 0; |
| 1032 | 1048 | ||
| 1033 | if (readable) | 1049 | if (readable) |