Merge pull request #10921 from MarcZX10/marc/fix-sysctl-copyout-null-source

fix(libkernel): skip the sysctl copy-out when no bytes are copied
This commit is contained in:
Dean authored and GitHub committed 2026-10-26 22:05:30 +13:00
commit 690c9c29c2
1 file changed
+1 -1
@@ -32,7 +32,7 @@ int CopyOut(const void* value, std::size_t size, void* oldValue, std::size_t* ol
return 0;
}
const std::size_t copied = std::min(oldLength != nullptr ? *oldLength : 0, size);
std::memcpy(oldValue, value, copied);
if (copied != 0) std::memcpy(oldValue, value, copied);
if (oldLength != nullptr) *oldLength = copied;
if (copied < size) {
*__error_nid_postfix() = 12;