Fix buffer size check in replyRead
We should not reject it when size==array.size(). Replace CHECK with CHECK_GE/LE for better logging. Bug: 38360920 Test: atest StorageManagerTest#testOpenProxyFileDescriptor_largeRead Change-Id: I5eae40f22aaaea50299260d5b25c454bf794d780
This commit is contained in:
@@ -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