Merge "TIF: Check the CEC message length before copying the data" into nyc-dev

am: b6748a2aec

* commit 'b6748a2aec3c4d7e41dccb69eaf29c76780ef4e8':
  TIF: Check the CEC message length before copying the data
This commit is contained in:
Jae Seo
2016-02-12 20:56:46 +00:00
committed by android-build-merger

View File

@@ -330,7 +330,7 @@ static jint nativeSendCecCommand(JNIEnv* env, jclass clazz, jlong controllerPtr,
jsize len = env->GetArrayLength(body);
message.length = MIN(len, CEC_MESSAGE_BODY_MAX_LENGTH);
ScopedByteArrayRO bodyPtr(env, body);
std::memcpy(message.body, bodyPtr.get(), len);
std::memcpy(message.body, bodyPtr.get(), message.length);
HdmiCecController* controller =
reinterpret_cast<HdmiCecController*>(controllerPtr);