United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6539281 -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
6539281 : -Xcheck:jni should validate char* argument to ReleaseStringUTFChars

Details
Type:
Enhancement
Submit Date:
2007-03-27
Status:
Closed
Updated Date:
2013-02-21
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs20

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
jni_ReleaseStringUTFChars(JNIEnv *, jstring, const char *) frees the storage associated with the third argument by calling FreeHeap().  Under -Xcheck:jni, we should consider verifying that the C string was in fact allocated by GetStringUTFChars.  This could be accomplished by allocating an extra byte or two in the checked version of GetSringUTFChars (immediately before the user pointer) and storing a magic value there, which would be verified in the subsequent Release call.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/build/hotspot/rev/017cd8bce8a8
                                     
2010-12-25
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/017cd8bce8a8
                                     
2010-12-10
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/017cd8bce8a8
                                     
2010-12-09
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/017cd8bce8a8
                                     
2010-12-07
EVALUATION

Ok.
                                     
2010-12-02



Hardware and Software, Engineered to Work Together