mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Prevent std::memcpy
from being called on null pointer in binding-sandbox/binding-base.h
This commit is contained in:
parent
3b0d8e7458
commit
2aa09e8529
1 changed files with 3 additions and 1 deletions
|
@ -223,7 +223,9 @@ namespace mkxp_sandbox {
|
|||
std::abort();
|
||||
}
|
||||
T *dst = (T *)sandbox_ptr(instance, dst_address);
|
||||
std::memcpy(dst, src, num_elements * sizeof(T));
|
||||
if (num_elements > 0) {
|
||||
std::memcpy(dst, src, num_elements * sizeof(T));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue