Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e9d8a31 authored by Haoran Zhang's avatar Haoran Zhang Committed by Automerger Merge Worker
Browse files

Merge "Since we are using string.subString(startIndex, endIndex) when parsing...

Merge "Since we are using string.subString(startIndex, endIndex) when parsing denylist, we should make sure startIndex <= endIndex before calling string.substring(). Otherwise, an index out of bound excpetion would throw and make the app terminate. This could happen if we are not careful with the denylist and make the denylist wrong formatted. For example, a ";" is left out in the end, and startIndex in this case would become -1." into udc-dev am: 51009536

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21487245



Change-Id: I72738f63fb9739b15853c653c13540fea6a1a345
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents de8ea019 51009536
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -899,9 +899,10 @@ public final class AutofillManager {

        // 3. Get the activity names substring between the indexes
        final int activityStringStartIndex = packageInStringIndex + packageName.length() + 1;
        if (activityStringStartIndex < firstNextSemicolonIndex) {
        if (activityStringStartIndex >= firstNextSemicolonIndex) {
            Log.e(TAG, "Failed to get denied activity names from denylist because it's wrongly "
                    + "formatted");
            return;
        }
        final String activitySubstring =
                denyListString.substring(activityStringStartIndex, firstNextSemicolonIndex);