Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5affd07 authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by android-build-merger
Browse files

Merge "[DO NOT MERGE] Throw exception if slot has invalid offset" into nyc-dev am: 69d20eab

am: d098c42e

Change-Id: I4bad8a26f1f721908f2b4bf6bcbe7497e93bc842
parents 33f5a3cc d098c42e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -205,6 +205,10 @@ static jbyteArray nativeGetBlob(JNIEnv* env, jclass clazz, jlong windowPtr,
    if (type == CursorWindow::FIELD_TYPE_BLOB || type == CursorWindow::FIELD_TYPE_STRING) {
        size_t 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);
        if (!byteArray) {
            env->ExceptionClear();
@@ -240,6 +244,10 @@ static jstring nativeGetString(JNIEnv* env, jclass clazz, jlong windowPtr,
    if (type == CursorWindow::FIELD_TYPE_STRING) {
        size_t 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) {
            return gEmptyString;
        }