mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-01-21 21:01:13 -05:00
28 lines
1.1 KiB
Diff
28 lines
1.1 KiB
Diff
|
From 560e0b6265e67b7a1f5e63da097e27485ba65a8f Mon Sep 17 00:00:00 2001
|
||
|
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
|
||
|
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
|
||
|
index 2142aae2ec74a..6c93c4651cec5 100644
|
||
|
--- a/core/java/android/content/Intent.java
|
||
|
+++ b/core/java/android/content/Intent.java
|
||
|
@@ -5112,6 +5112,9 @@ public static Intent parseUri(String uri, int flags) throws URISyntaxException {
|
||
|
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
|