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

Commit e6044145 authored by Vasu Nori's avatar Vasu Nori
Browse files

bug:3467948 if byteArray couldn't be allocated for blob, throw exception

Change-Id: I73e36c10f31086ea567debad536350316b2df67f
parent ee4d1a67
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -208,7 +208,10 @@ LOG_WINDOW("Getting blob for %d,%d from %p", row, column, window);
    uint8_t type = field.type;
    if (type == FIELD_TYPE_BLOB || type == FIELD_TYPE_STRING) {
        jbyteArray byteArray = env->NewByteArray(field.data.buffer.size);
        LOG_ASSERT(byteArray, "Native could not create new byte[]");
        if (!byteArray) {
            throw_sqlite3_exception(env, "Native could not create new byte[]");
            return NULL;
        }
        env->SetByteArrayRegion(byteArray, 0, field.data.buffer.size,
            (const jbyte*)window->offsetToPtr(field.data.buffer.offset));
        return byteArray;