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

Commit 65b870a2 authored by William Leshner's avatar William Leshner Committed by Automerger Merge Worker
Browse files

Merge "Fix vulnerability that allowed attackers to start arbitary activities"...

Merge "Fix vulnerability that allowed attackers to start arbitary activities" into tm-dev am: f00e7d5c

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



Change-Id: I328fc76ac588d54387d4cb146cfd2ef33d12e9a2
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1ea7c1ba f00e7d5c
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -1192,8 +1192,17 @@ public class DreamService extends Service implements Window.Callback {
        if (!flattenedString.contains("/")) {
            return new ComponentName(serviceInfo.packageName, flattenedString);
        }

        return ComponentName.unflattenFromString(flattenedString);
        // Ensure that the component is from the same package as the dream service. If not,
        // treat the component as invalid and return null instead.
        final ComponentName cn = ComponentName.unflattenFromString(flattenedString);
        if (cn == null) return null;
        if (!cn.getPackageName().equals(serviceInfo.packageName)) {
            Log.w(TAG,
                    "Inconsistent package name in component: " + cn.getPackageName()
                            + ", should be: " + serviceInfo.packageName);
            return null;
        }
        return cn;
    }

    /**