Skip to content

small bug #112

@RFoe

Description

@RFoe

Potential Initialization Bug in B+Tree Node Splitting

Report

In db.c:683-689, there's a potential logical error:

if (get_node_type(root) == NODE_INTERNAL) {
 initialize_internal_node(right_child);
 initialize_internal_node(left_child);  // This initialization is lost
}
/* Left child has data copied from old root */
memcpy(left_child, root, PAGE_SIZE);     // Overwrites the initialization

The initialize_internal_node(left_child) call is wasted because the subsequent memcpy completely overwrites left_child.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions