Skip to content

Prevent potential invalid access for string array pretty print - #41673

Open
Feng Wang (chemwolf6922) wants to merge 1 commit into
masterfrom
user/chemwolf6922/prevent-potential-invalid-access-for-string-array-pretty-print
Open

Feng Wang (chemwolf6922) wants to merge 1 commit into
masterfrom
user/chemwolf6922/prevent-potential-invalid-access-for-string-array-pretty-print

Conversation

@chemwolf6922

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

This PR follows the work in #41669 and adds length check for string arrays as well.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Update test:
UnitTests::UnitTests::PrettyPrintOutOfBoundsFields

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.

Copilot review overview

🟢 Approval recommended

The bounds check prevents invalid pointer arithmetic and the added tests cover the new behavior.

Review effort: Lite
Findings: None

What changed in this PR

This PR hardens string-array pretty-printing against out-of-bounds message offsets and adds unit coverage.

Changes:

  • Validate StringArray offsets before constructing spans.
  • Test out-of-bounds and empty array cases.
File Description
src/​shared/​inc/​prettyprintshared.h Adds bounds-safe string-array printing.
test/​windows/​UnitTests.cpp Covers invalid and empty offsets.

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

This branch has not been deployed

No deployments
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.

STRING_ARRAY_FIELD pretty-printing lacks the STRING_FIELD bounds check (out-of-bounds read)

2 participants