libwine: Pass the correct length to GetStringUTFRegion.

Spotted by Jactry Zeng.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Alexandre Julliard 2015-10-19 15:43:07 +09:00
parent 175138a42c
commit d197252fb3
1 changed files with 2 additions and 1 deletions

View File

@ -851,7 +851,8 @@ static jstring wine_init_jni( JNIEnv *env, jobject obj, jobjectArray cmdline, jo
{
jobject str_obj = (*env)->GetObjectArrayElement( env, cmdline, i );
length = (*env)->GetStringUTFLength( env, str_obj );
(*env)->GetStringUTFRegion( env, str_obj, 0, length, str );
(*env)->GetStringUTFRegion( env, str_obj, 0,
(*env)->GetStringLength( env, str_obj ), str );
argv[i] = str;
str[length] = 0;
str += length + 1;