Repository navigation
Avoid argv allocation size overflow - #429
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens shell argv construction in shelltool by removing an integer-overflow-prone capacity calculation while keeping the “copy-on-combine” semantics (i.e., not aliasing the input slices).
Changes:
- Replaces the manual
make(..., len(extra)+len(suffix))capacity computation with aslices-based approach to avoid overflow in allocation size math. - Simplifies
combineArgvimplementation used by both stateless and persistent shell argv construction.
Show a summary per file
| File | Description |
|---|---|
| tool/shelltool/localshell.go | Updates argv combination to avoid allocation-size overflow during shell command invocation setup. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
This comment has been minimized.
This comment has been minimized.
71da681 to
6b85ec1
Compare
Cross-Repo Parity Review — PR #429Result: Out of scope — no parity issues. This PR only modifies the unexported No upstream .NET or Python parity check is required.
|
Summary
len(extra)+len(suffix)capacity calculation in shell argv construction withslices.Concat(extra, suffix).Fixes Size computation for allocation may overflow · Code scanning alert #1 · microsoft/agent-framework-go.
Validation
go test -count=1 ./tool/shelltool