Skip to content

v5: memset MCInst on init. - #3032

Merged
Rot127 merged 1 commit into
capstone-engine:v5from
Rot127:uintmem
Aug 13, 2026
Merged

Rot127 merged 1 commit into
capstone-engine:v5from
Rot127:uintmem

Conversation

@Rot127

@Rot127 Rot127 commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

Addresses the report about TMS320 in GHSA-8qp8-2vg2-8mr4

Test plan

Locally

Closing issues

...

Since everybody figured out how to script an
LLM vulnerability scanner, we get an annoying amount of
"use of uninitialized memory" reports.

MCInst is stack memory here, so I doubt this has
an impact on performance.
@github-actions github-actions Bot added the LLVM-core-files auto-sync label Aug 13, 2026
@Rot127 Rot127 changed the title memset MCInst on init. v5: memset MCInst on init. Aug 13, 2026
@Rot127
Rot127 requested a lite review from Copilot August 13, 2026 09:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Capstone’s internal MCInst initialization to fully zero-initialize the MCInst struct on creation, addressing a security advisory report related to TMS320 behavior.

Changes:

  • Replace manual field-by-field initialization in MCInst_Init() with memset(inst, 0, sizeof(MCInst)).
  • Preserve the required non-zero default for tied_op_idx[] by explicitly setting all entries to -1 after the memset.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@Rot127
Rot127 merged commit cc6f8e0 into capstone-engine:v5 Aug 13, 2026
24 checks passed
@Rot127
Rot127 deleted the uintmem branch August 13, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants