mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibSQL: Fix BTree corruption in TreeNode::split
After splitting a node, the new node was written to the same pointer as the current node - probably a copy / paste error. This new code requires a `.pointer() -> u32` to exist on the object to be serialized, preventing this issue from happening again. Fixes #15844.
This commit is contained in:
parent
e5e00a682b
commit
70a7bca920
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/gmta
Commit: 70a7bca920
Pull-request: https://github.com/SerenityOS/serenity/pull/16197
Issue: https://github.com/SerenityOS/serenity/issues/15844
Reviewed-by: https://github.com/trflynn89 ✅
7 changed files with 35 additions and 16 deletions
|
@ -108,12 +108,12 @@ public:
|
|||
void serialize(String const&);
|
||||
|
||||
template<typename T>
|
||||
bool serialize_and_write(T const& t, u32 pointer)
|
||||
bool serialize_and_write(T const& t)
|
||||
{
|
||||
VERIFY(m_heap.ptr() != nullptr);
|
||||
reset();
|
||||
serialize<T>(t);
|
||||
m_heap->add_to_wal(pointer, m_buffer);
|
||||
m_heap->add_to_wal(t.pointer(), m_buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue