Skip to content

Prevent FullDebugMode allocation size overflow - #103

Open
maximmasiutin wants to merge 1 commit into
pleriche:masterfrom
maximmasiutin:fix/fulldebugmode-size-overflow
Open

Prevent FullDebugMode allocation size overflow#103
maximmasiutin wants to merge 1 commit into
pleriche:masterfrom
maximmasiutin:fix/fulldebugmode-size-overflow

Conversation

@maximmasiutin

Copy link
Copy Markdown

Reject unsafe FullDebugMode allocation sizes before adding debug overhead, preventing wrapped allocations and out-of-bounds footer writes.

Copilot AI lite review requested due to automatic review settings August 16, 2026 04:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request hardens FastMM4’s FullDebugMode allocation paths by rejecting request sizes that would overflow when the FullDebugMode header/trailer overhead is added, preventing wrapped allocations and potential out-of-bounds writes during debug footer/header handling.

Changes:

  • Add overflow/negative-size validation in DebugGetMem before calling FastGetMem(ASize + FullDebugBlockOverhead).
  • Add the same validation in DebugReallocMem before performing size-based fit checks and potential reallocation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@maximmasiutin

Copy link
Copy Markdown
Author

@CodeRabbit review
@codex review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants