JDK-6539281 : -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-03-27
  • Updated: 2013-02-21
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u25Fixed 7Fixed hs20Fixed
Related Reports
Relates :  
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
25-12-2010

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

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

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

EVALUATION Ok.
02-12-2010