Loading core/jni/android_database_CursorWindow.cpp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -179,6 +179,10 @@ static jbyteArray nativeGetBlob(JNIEnv* env, jclass clazz, jint windowPtr, if (type == CursorWindow::FIELD_TYPE_BLOB || type == CursorWindow::FIELD_TYPE_STRING) { if (type == CursorWindow::FIELD_TYPE_BLOB || type == CursorWindow::FIELD_TYPE_STRING) { size_t size; size_t size; const void* value = window->getFieldSlotValueBlob(fieldSlot, &size); const void* value = window->getFieldSlotValueBlob(fieldSlot, &size); if (!value) { throw_sqlite3_exception(env, "Native could not read blob slot"); return NULL; } jbyteArray byteArray = env->NewByteArray(size); jbyteArray byteArray = env->NewByteArray(size); if (!byteArray) { if (!byteArray) { env->ExceptionClear(); env->ExceptionClear(); Loading Loading @@ -214,6 +218,10 @@ static jstring nativeGetString(JNIEnv* env, jclass clazz, jint windowPtr, if (type == CursorWindow::FIELD_TYPE_STRING) { if (type == CursorWindow::FIELD_TYPE_STRING) { size_t sizeIncludingNull; size_t sizeIncludingNull; const char* value = window->getFieldSlotValueString(fieldSlot, &sizeIncludingNull); const char* value = window->getFieldSlotValueString(fieldSlot, &sizeIncludingNull); if (!value) { throw_sqlite3_exception(env, "Native could not read string slot"); return NULL; } if (sizeIncludingNull <= 1) { if (sizeIncludingNull <= 1) { return gEmptyString; return gEmptyString; } } Loading Loading
core/jni/android_database_CursorWindow.cpp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -179,6 +179,10 @@ static jbyteArray nativeGetBlob(JNIEnv* env, jclass clazz, jint windowPtr, if (type == CursorWindow::FIELD_TYPE_BLOB || type == CursorWindow::FIELD_TYPE_STRING) { if (type == CursorWindow::FIELD_TYPE_BLOB || type == CursorWindow::FIELD_TYPE_STRING) { size_t size; size_t size; const void* value = window->getFieldSlotValueBlob(fieldSlot, &size); const void* value = window->getFieldSlotValueBlob(fieldSlot, &size); if (!value) { throw_sqlite3_exception(env, "Native could not read blob slot"); return NULL; } jbyteArray byteArray = env->NewByteArray(size); jbyteArray byteArray = env->NewByteArray(size); if (!byteArray) { if (!byteArray) { env->ExceptionClear(); env->ExceptionClear(); Loading Loading @@ -214,6 +218,10 @@ static jstring nativeGetString(JNIEnv* env, jclass clazz, jint windowPtr, if (type == CursorWindow::FIELD_TYPE_STRING) { if (type == CursorWindow::FIELD_TYPE_STRING) { size_t sizeIncludingNull; size_t sizeIncludingNull; const char* value = window->getFieldSlotValueString(fieldSlot, &sizeIncludingNull); const char* value = window->getFieldSlotValueString(fieldSlot, &sizeIncludingNull); if (!value) { throw_sqlite3_exception(env, "Native could not read string slot"); return NULL; } if (sizeIncludingNull <= 1) { if (sizeIncludingNull <= 1) { return gEmptyString; return gEmptyString; } } Loading