From aa7b525204b537a58b6ba5f611d242850c7adf8a Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 7 Jul 2022 16:50:54 +0000 Subject: [PATCH] Parcel marshall - disallow RPC Parcels RPC Parcels need to be interpreted in the context of an RPC session. Otherwise, they don't make sense. Bug: N/A Test: N/A Change-Id: I7a7b83341372faae357927f1b23be181b2f907af --- core/jni/android_os_Parcel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp index acadac78ce135..bb4ab39a59d18 100644 --- a/core/jni/android_os_Parcel.cpp +++ b/core/jni/android_os_Parcel.cpp @@ -549,6 +549,11 @@ static jbyteArray android_os_Parcel_marshall(JNIEnv* env, jclass clazz, jlong na return NULL; } + if (parcel->isForRpc()) { + jniThrowException(env, "java/lang/RuntimeException", "Tried to marshall an RPC Parcel."); + return NULL; + } + if (parcel->objectsCount()) { jniThrowException(env, "java/lang/RuntimeException",