summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-12-11 11:24:37 -0800
committerMike Lockwood <lockwood@android.com>2010-12-11 11:29:31 -0800
commit2711e494caf9ec665c46258feb36c9654290f6e0 (patch)
treeaee12369908118dd60424b68452ef5379f96efcd /media
parent086c0611d3680fbc2951f2b469bf78257ef4aed7 (diff)
downloadframeworks_base-2711e494caf9ec665c46258feb36c9654290f6e0.zip
frameworks_base-2711e494caf9ec665c46258feb36c9654290f6e0.tar.gz
frameworks_base-2711e494caf9ec665c46258feb36c9654290f6e0.tar.bz2
MTP: Check for null string before calling GetStringUTFChars() in MtpDatabase JNI
BUG: 3274649 Change-Id: I5a3c8fcebf71ed453a121ca5a1345e39895d3bf3 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media')
-rw-r--r--media/jni/android_media_MtpDatabase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/jni/android_media_MtpDatabase.cpp b/media/jni/android_media_MtpDatabase.cpp
index bce1241..c08e51b 100644
--- a/media/jni/android_media_MtpDatabase.cpp
+++ b/media/jni/android_media_MtpDatabase.cpp
@@ -710,7 +710,7 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyList(MtpObjectHandle handle,
break;
case MTP_TYPE_STR: {
jstring value = (jstring)env->GetObjectArrayElement(stringValuesArray, i);
- const char *valueStr = env->GetStringUTFChars(value, NULL);
+ const char *valueStr = (value ? env->GetStringUTFChars(value, NULL) : NULL);
if (valueStr) {
packet.putString(valueStr);
env->ReleaseStringUTFChars(value, valueStr);