8027230: Overflow in java.lang.instrument.Instrumentation.getObjectSize() method

Reviewed-by: dholmes, sspitsyn
This commit is contained in:
Peter Allwin 2014-05-22 09:12:29 +02:00
parent ead7a2760b
commit 09afb7b210
4 changed files with 112 additions and 2 deletions

View file

@ -307,9 +307,9 @@ JvmtiEnv::GetObjectSize(jobject object, jlong* size_ptr) {
!java_lang_Class::is_primitive(mirror)) {
Klass* k = java_lang_Class::as_Klass(mirror);
assert(k != NULL, "class for non-primitive mirror must exist");
*size_ptr = k->size() * wordSize;
*size_ptr = (jlong)k->size() * wordSize;
} else {
*size_ptr = mirror->size() * wordSize;
*size_ptr = (jlong)mirror->size() * wordSize;
}
return JVMTI_ERROR_NONE;
} /* end GetObjectSize */