Changeset 5563 for pjproject


Ignore:
Timestamp:
Mar 7, 2017 3:28:56 AM (8 years ago)
Author:
riza
Message:

Re #1994: Prevent overflow on pj_generate_unique_string() for android.
Thanks to Esed Alihodzic for the report and patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/guid_android.c

    r5272 r5563  
    7070        goto on_error; 
    7171 
    72     uuid_class = (jclass)(*jni_env)->NewGlobalRef(jni_env, 
    73                  (*jni_env)->FindClass(jni_env, "java/util/UUID")); 
     72    uuid_class = (*jni_env)->FindClass(jni_env, "java/util/UUID"); 
     73 
    7474    if (uuid_class == 0) 
    7575        goto on_error; 
     
    107107 
    108108    (*jni_env)->ReleaseStringUTFChars(jni_env, uuid_string, native_string); 
     109    (*jni_env)->DeleteLocalRef(jni_env, javaUuid); 
     110    (*jni_env)->DeleteLocalRef(jni_env, uuid_class); 
     111    (*jni_env)->DeleteLocalRef(jni_env, uuid_string); 
    109112    detach_jvm(attached); 
    110113 
Note: See TracChangeset for help on using the changeset viewer.