Skip to content

GGUF: check that tensor size is representable#19072

Merged
JohannesGaessler merged 1 commit intoggml-org:masterfrom
JohannesGaessler:gguf-fix-nbytes-overflow
Jan 24, 2026
Merged

GGUF: check that tensor size is representable#19072
JohannesGaessler merged 1 commit intoggml-org:masterfrom
JohannesGaessler:gguf-fix-nbytes-overflow

Conversation

@JohannesGaessler
Copy link
Copy Markdown
Contributor

See #18674 .

Currently gguf.cpp is only checking that the number of elements is representable as int64_t. Though feasibly there could be a file with a number of elements that is still representable but a size in bytes that is > SIZE_MAX. This PR adds a corresponding check and a test case in test-gguf.cpp.

@JohannesGaessler JohannesGaessler force-pushed the gguf-fix-nbytes-overflow branch from ce1e839 to c582c3b Compare January 24, 2026 17:11
@github-actions github-actions Bot added testing Everything test related ggml changes relating to the ggml tensor library for machine learning labels Jan 24, 2026
@JohannesGaessler JohannesGaessler merged commit 4e5b83b into ggml-org:master Jan 24, 2026
78 checks passed
shaofeiqi pushed a commit to qualcomm/llama.cpp that referenced this pull request Feb 6, 2026
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants