OSDN Git Service

Sanity check to avoice NPE if an app-provided URI is invalid.
authorFelipe Leme <felipeal@google.com>
Thu, 1 Mar 2018 01:37:52 +0000 (17:37 -0800)
committerFelipe Leme <felipeal@google.com>
Thu, 1 Mar 2018 01:43:34 +0000 (17:43 -0800)
Test: atest VirtualContainerActivityCompatModeTest#testAutofillSync

Fixes: 73790788

Change-Id: Ic73eb800f4532425effb03396f0ab455142ab6dc

core/java/android/app/assist/AssistStructure.java

index 1312a2e..ef41b10 100644 (file)
@@ -1309,6 +1309,11 @@ public class AssistStructure implements Parcelable {
             if (domain == null) return;
 
             final Uri uri = Uri.parse(domain);
+            if (uri == null) {
+                // Cannot log domain because it could contain PII;
+                Log.w(TAG, "Failed to parse web domain");
+                return;
+            }
             mWebScheme = uri.getScheme();
             mWebDomain = uri.getHost();
         }