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

Commit 0adf32bc authored by Alan Viverette's avatar Alan Viverette
Browse files

Fix parsing of old-style intent URIs

Improves bounds checking to restrict category matches to within the
category(...) item. Fixes CTS failure in IntentTest.testGetIntentOld().

BUG: 17557490
Change-Id: I1859fe18eaa881b771bab373d705d8fbeb6406c4
parent 80ea66b1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4295,7 +4295,7 @@ public class Intent implements Parcelable, Cloneable {
                int j = uri.indexOf(')', i);
                while (i < j) {
                    int sep = uri.indexOf('!', i);
                    if (sep < 0) sep = j;
                    if (sep < 0 || sep > j) sep = j;
                    if (i < sep) {
                        intent.addCategory(uri.substring(i, sep));
                    }