Skip to content

Commit ee6a0ff

Browse files
committed
8360664 Null pointer dereference in src/hotspot/share/prims/jvmtiTagMap.cpp in IterateOverHeapObjectClosure::do_object()
Found by Linux Verification Center (linuxtesting.org) with SVACE. signed-off-by: Artem Semenov ([email protected]).
1 parent 5039b42 commit ee6a0ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/hotspot/share/prims/jvmtiTagMap.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ class IterateOverHeapObjectClosure: public ObjectClosure {
944944

945945
// invoked for each object in the heap
946946
void IterateOverHeapObjectClosure::do_object(oop o) {
947+
if (o == nullptr) return;
947948
// check if iteration has been halted
948949
if (is_iteration_aborted()) return;
949950

@@ -953,7 +954,7 @@ void IterateOverHeapObjectClosure::do_object(oop o) {
953954
}
954955

955956
// skip if object is a dormant shared object whose mirror hasn't been loaded
956-
if (o != nullptr && o->klass()->java_mirror() == nullptr) {
957+
if (o->klass()->java_mirror() == nullptr) {
957958
log_debug(aot, heap)("skipped dormant archived object " INTPTR_FORMAT " (%s)", p2i(o),
958959
o->klass()->external_name());
959960
return;
@@ -1032,14 +1033,15 @@ class IterateThroughHeapObjectClosure: public ObjectClosure {
10321033

10331034
// invoked for each object in the heap
10341035
void IterateThroughHeapObjectClosure::do_object(oop obj) {
1036+
if (obj == nullptr) return;
10351037
// check if iteration has been halted
10361038
if (is_iteration_aborted()) return;
10371039

10381040
// apply class filter
10391041
if (is_filtered_by_klass_filter(obj, klass())) return;
10401042

10411043
// skip if object is a dormant shared object whose mirror hasn't been loaded
1042-
if (obj != nullptr && obj->klass()->java_mirror() == nullptr) {
1044+
if (obj->klass()->java_mirror() == nullptr) {
10431045
log_debug(aot, heap)("skipped dormant archived object " INTPTR_FORMAT " (%s)", p2i(obj),
10441046
obj->klass()->external_name());
10451047
return;

0 commit comments

Comments
 (0)