diff options
author | Steve Block <steveblock@google.com> | 2011-07-19 16:57:32 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-07-19 16:58:52 +0100 |
commit | 4f25266c21bdd7dcd9996807fae04f7dfb0373de (patch) | |
tree | 0f489ac388590c0d0970e9200435361205a2ecec /Source/WebCore/bridge/jni | |
parent | d2c2030045e0e26787ff8b9935d449e3be8a71cc (diff) | |
download | external_webkit-4f25266c21bdd7dcd9996807fae04f7dfb0373de.zip external_webkit-4f25266c21bdd7dcd9996807fae04f7dfb0373de.tar.gz external_webkit-4f25266c21bdd7dcd9996807fae04f7dfb0373de.tar.bz2 |
Cherry-pick WebKit change 91260 to fix JNI string null-termination
See http://trac.webkit.org/changeset/91260
Bug: 4727789
Change-Id: I2f01bde12463a3c19659340cdb85b69eaecbd0f7
Diffstat (limited to 'Source/WebCore/bridge/jni')
-rw-r--r-- | Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp b/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp index cd04634..0d1a9f2 100644 --- a/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp +++ b/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp @@ -429,10 +429,10 @@ JavaValue jvalueToJavaValue(const jvalue& value, const JavaType& type) case JavaTypeString: { jstring javaString = static_cast<jstring>(value.l); - const UChar* a = getUCharactersFromJStringInEnv(getJNIEnv(), javaString); + const UChar* characters = getUCharactersFromJStringInEnv(getJNIEnv(), javaString); // We take a copy to allow the Java String to be released. - result.m_stringValue = String(a).threadsafeCopy(); - releaseUCharactersForJStringInEnv(getJNIEnv(), javaString, a); + result.m_stringValue = String(characters, getJNIEnv()->GetStringLength(javaString)); + releaseUCharactersForJStringInEnv(getJNIEnv(), javaString, characters); } break; case JavaTypeBoolean: |