mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-18 10:50:23 +00:00
8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer passed as argument 2, which is declared to never be null
Reviewed-by: clanger, mdoerr
This commit is contained in:
parent
ed81a478e1
commit
be1d374bc5
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user