mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:57:34 +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
1 changed files with 1 additions and 0 deletions
|
@ -63,6 +63,7 @@ public:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
if (!region->commit())
|
if (!region->commit())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
memcpy(region->vaddr().as_ptr(), bytes.data(), bytes.size());
|
||||||
return adopt(*new KBufferImpl(region.release_nonnull(), bytes.size()));
|
return adopt(*new KBufferImpl(region.release_nonnull(), bytes.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue