Merge "Fix buffer size check in replyRead" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cf7b8a1406
@@ -166,8 +166,8 @@ void com_android_internal_os_FuseAppLoop_replyWrite(
|
||||
void com_android_internal_os_FuseAppLoop_replyRead(
|
||||
JNIEnv* env, jobject self, jlong ptr, jlong unique, jint size, jbyteArray data) {
|
||||
ScopedByteArrayRO array(env, data);
|
||||
CHECK(size >= 0);
|
||||
CHECK(static_cast<size_t>(size) < array.size());
|
||||
CHECK_GE(size, 0);
|
||||
CHECK_LE(static_cast<size_t>(size), array.size());
|
||||
if (!reinterpret_cast<fuse::FuseAppLoop*>(ptr)->ReplyRead(unique, size, array.get())) {
|
||||
reinterpret_cast<fuse::FuseAppLoop*>(ptr)->Break();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user