Skip to content

fix: do not preallocate tensor infos from split.tensors.count - #74

Merged
thxCode merged 1 commit into
gpustack:mainfrom
jpatel2005:fix/split-tensors-count
Nov 19, 2026
Merged

thxCode merged 1 commit into
gpustack:mainfrom
jpatel2005:fix/split-tensors-count

Conversation

@jpatel2005

Copy link
Copy Markdown
Contributor

ParseGGUFFile uses the untrusted split.tensors.count value as a slice capacity. Negative values cause a panic, while very large values can result in excessive allocation.

Remove the preallocation and grow the slice as tensor infos are read.

TestParseGGUFFile_InvalidSplitTensorsCount covers the negative-value case.

Signed-off-by: Jai Patel <mitjaipp@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 01:44

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@gpustack-code-review

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

@thxCode thxCode 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.

LGTM

@thxCode
thxCode merged commit 0e0a421 into gpustack:main Nov 19, 2026
3 checks passed
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.

3 participants