mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
Kernel: Make KBuffer::try_create_with_bytes() actually copy the bytes
KBuffers created with this API were actually just zero-filled instead of being populated with the provided bytes. Fixes #4493.
This commit is contained in:
parent
99d6b3b80b
commit
c77dda6827
|
@ -63,6 +63,7 @@ public:
|
|||
return nullptr;
|
||||
if (!region->commit())
|
||||
return nullptr;
|
||||
memcpy(region->vaddr().as_ptr(), bytes.data(), bytes.size());
|
||||
return adopt(*new KBufferImpl(region.release_nonnull(), bytes.size()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue