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

This commit is contained in:
Jae Seo
2016-02-12 20:50:43 +00:00
committed by Android (Google) Code Review

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);