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

Commit 63ffd78a authored by Mike Lockwood's avatar Mike Lockwood Committed by Marco Nelissen
Browse files

MtpDatabase: Increase size of string buffer in JNI code

Fixes problems handling files that have full path length > 255 characters

Bug: 17383223
Change-Id: I2a1ebedee8dd86b3060f14c2d1af636fc9bc95cb
parent eb35fa56
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -207,7 +207,8 @@ MyMtpDatabase::MyMtpDatabase(JNIEnv *env, jobject client)
        return; // Already threw.
    }
    mLongBuffer = (jlongArray)env->NewGlobalRef(longArray);
    jcharArray charArray = env->NewCharArray(256);
    // Needs to be long enough to hold a file path for getObjectFilePath()
    jcharArray charArray = env->NewCharArray(PATH_MAX + 1);
    if (!charArray) {
        return; // Already threw.
    }
@@ -761,7 +762,7 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyList(MtpObjectHandle handle,
    return result;
}

static void foreachentry(ExifEntry *entry, void *user) {
static void foreachentry(ExifEntry *entry, void * /*user*/) {
    char buf[1024];
    ALOGI("entry %x, format %d, size %d: %s",
            entry->tag, entry->format, entry->size, exif_entry_get_value(entry, buf, sizeof(buf)));