Skip to content

CRITICAL: Endianness violation - integer keys serialized as system-endian #146

Description

@poyrazK

Why is this an issue?

In src/storage/btree_index.cpp:60:

std::memcpy(data, &v, sizeof(v));  // System-endian

On big-endian systems, integer keys are serialized incorrectly. No byte-order functions (htonl, ntohl) used.

What is causing it?

No endianness handling in serialization.

How can it be solved?

Use htonl/htonll for serialization, ntohl/ntohll for deserialization.

Category

  • Small
  • Medium
  • Large
  • Critical

Severity

  • Low
  • Medium
  • High
  • Critical

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions