summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-02-17 13:24:37 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-02-17 13:24:37 -0800
commit574ecc8ed943d0c3148bff4fd7b28d65d9cc1cad (patch)
tree9e434310bfb5b7301e15df82f3d77b8772b59f4e /core/jni
parent479ae0a28099eb77299fe0f44d4dfabce3115fb6 (diff)
parent073a3d56ea7505126469dd9ed4c20a7a8923690d (diff)
downloadframeworks_base-574ecc8ed943d0c3148bff4fd7b28d65d9cc1cad.zip
frameworks_base-574ecc8ed943d0c3148bff4fd7b28d65d9cc1cad.tar.gz
frameworks_base-574ecc8ed943d0c3148bff4fd7b28d65d9cc1cad.tar.bz2
Merge "Add better index checks for AndroidCharacter.mirror"
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_text_AndroidCharacter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/jni/android_text_AndroidCharacter.cpp b/core/jni/android_text_AndroidCharacter.cpp
index 1353478..5d8d419 100644
--- a/core/jni/android_text_AndroidCharacter.cpp
+++ b/core/jni/android_text_AndroidCharacter.cpp
@@ -165,7 +165,8 @@ static jboolean mirror(JNIEnv* env, jobject obj, jcharArray charArray, int start
goto MIRROR_END;
}
- if (start > start + count || env->GetArrayLength(charArray) < count) {
+ if (start < 0 || start > start + count
+ || env->GetArrayLength(charArray) < start + count) {
jniThrowException(env, "java/lang/ArrayIndexOutOfBoundsException", NULL);
goto MIRROR_END;
}