6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars

Tag allocated memory with a magic value and verify when releasing.

Reviewed-by: phh, stefank
This commit is contained in:
Staffan Larsen 2010-12-07 03:15:45 -08:00
parent dd62e29b29
commit 1765b0fbf0
4 changed files with 65 additions and 17 deletions

View file

@ -104,6 +104,7 @@ class java_lang_String : AllStatic {
// String converters
static char* as_utf8_string(oop java_string);
static char* as_utf8_string(oop java_string, char* buf, int buflen);
static char* as_utf8_string(oop java_string, int start, int len);
static char* as_platform_dependent_str(Handle java_string, TRAPS);
static jchar* as_unicode_string(oop java_string, int& length);