Skip to content

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

Merged
Ben Hillis (benhillis) merged 1 commit into
masterfrom
user/chemwolf6922/prevent-potential-invalid-access-for-string-array-pretty-print
Sep 22, 2026
Merged

Ben Hillis (benhillis) merged 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.

@OneBlue Blue (OneBlue) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good catch, thank you !

@benhillis
Ben Hillis (benhillis) merged commit 8fbdba5 into master Sep 22, 2026
12 checks passed
@benhillis
Ben Hillis (benhillis) deleted the user/chemwolf6922/prevent-potential-invalid-access-for-string-array-pretty-print branch September 22, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants