Skip to content

Commit a7e4ab9

Browse files
committed
8333730: ubsan: FieldIndices/libFieldIndicesTest.cpp:276:11: runtime error: null pointer passed as argument 2, which is declared to never be null
Reviewed-by: cjplummer, amenkov
1 parent abbf45b commit a7e4ab9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/hotspot/jtreg/serviceability/jvmti/FollowReferences/FieldIndices/libFieldIndicesTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ void Klass::explore_interfaces(JNIEnv* env) {
273273
if (super_klass != nullptr) {
274274
// Add all interfaces implemented by super_klass first.
275275
interface_count = super_klass->interface_count;
276-
memcpy(interfaces, super_klass->interfaces, sizeof(Klass*) * super_klass->interface_count);
276+
if (super_klass->interfaces != nullptr) {
277+
memcpy(interfaces, super_klass->interfaces, sizeof(Klass*) * super_klass->interface_count);
278+
}
277279
}
278280

279281
// Interfaces implemented by the klass.

0 commit comments

Comments
 (0)