mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user