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

Reviewed-by: clanger, mdoerr
  • Loading branch information
MBaesken committed May 27, 2024
1 parent ed81a47 commit be1d374
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 @@ -32,7 +32,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

0 comments on commit be1d374

Please sign in to comment.