2024-10-13 16:07:25 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2024-10-13 15:41:31 -04:00
|
|
|
From: William Loh <wloh@google.com>
|
|
|
|
Date: Mon, 3 Jun 2024 12:56:47 -0700
|
|
|
|
Subject: [PATCH] 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)
|
2024-10-13 15:51:16 -04:00
|
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5d754ed6dd1fd321746f5ec4742831ffd97a9967)
|
2024-10-13 15:41:31 -04:00
|
|
|
Merged-In: I5f619ced684ff505ce2b7408cd35dd3e9be89dea
|
|
|
|
Change-Id: I5f619ced684ff505ce2b7408cd35dd3e9be89dea
|
|
|
|
---
|
|
|
|
core/java/android/content/Intent.java | 3 +++
|
|
|
|
1 file changed, 3 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
|
2024-10-13 16:07:25 -04:00
|
|
|
index 24d59a0826c8..4ea29407f352 100644
|
2024-10-13 15:41:31 -04:00
|
|
|
--- a/core/java/android/content/Intent.java
|
|
|
|
+++ b/core/java/android/content/Intent.java
|
2024-10-13 16:07:25 -04:00
|
|
|
@@ -7053,6 +7053,9 @@ public class Intent implements Parcelable, Cloneable {
|
2024-10-13 15:41:31 -04:00
|
|
|
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
|