commit | 071cba9eff20de3492becf4a77904ec259915f60 | [log] [tgz] |
---|---|---|
author | William Loh <wloh@google.com> | Mon Jun 03 12:56:47 2024 -0700 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Aug 07 23:07:21 2024 +0000 |
tree | d94a2f830a2a4230e8f8f3765263e29cffad2574 | |
parent | 03b3a136c050fef0cd9ff91ccb87b49671157006 [diff] |
Fail parseUri if end is missing Bug: 318683126 Test: atest IntentTest Flag: EXEMPT bugfix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b85bee508793e31d6fe37fc9cd4e8fa3787113cc) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:77c140c674ec1cec011989f4a2c2666949771370) Merged-In: I5f619ced684ff505ce2b7408cd35dd3e9be89dea Change-Id: I5f619ced684ff505ce2b7408cd35dd3e9be89dea
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index aa765e3..22839a0 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java
@@ -7602,6 +7602,9 @@ int eq = uri.indexOf('=', i); if (eq < 0) eq = i-1; int semi = uri.indexOf(';', i); + if (semi < 0) { + throw new URISyntaxException(uri, "uri end not found"); + } String value = eq < semi ? Uri.decode(uri.substring(eq + 1, semi)) : ""; // action