Skip to content

Commit

Permalink
8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer …
Browse files Browse the repository at this point in the history
…passed as argument 2, which is declared to never be null

Backport-of: be1d374bc54d43aae3b3c1feace22d38fe2156b6
  • Loading branch information
MBaesken committed Jun 17, 2024
1 parent 762e983 commit c08de56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hotspot/share/memory/guardedMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ void* GuardedMemory::wrap_copy(const void* ptr, const size_t len, const void* ta
if (outerp != nullptr) {
GuardedMemory guarded(outerp, len, tag);
void* innerp = guarded.get_user_ptr();
memcpy(innerp, ptr, len);
if (ptr != nullptr) {
memcpy(innerp, ptr, len);
}
return innerp;
}
return nullptr; // OOM
Expand Down

1 comment on commit c08de56

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.