]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
gguf : harden loader against malformed tensor dims and metadata types (#25596)
authorHarrisonSec <redacted>
Wed, 12 Aug 2026 12:07:48 +0000 (05:07 -0700)
committerGitHub <redacted>
Wed, 12 Aug 2026 12:07:48 +0000 (15:07 +0300)
commitd8a8beac22d450ebadf175a8ce7b6bf49b66db14
treea680a783bf7fbfc3364767cd8abc9ee2904df016
parent132753bf4e52b1a8bda8f6ec33f1785bd80470da
gguf : harden loader against malformed tensor dims and metadata types (#25596)

* gguf : harden loader against malformed tensor dims and metadata types

* gguf: address review on malformed-metadata hardening

- report the expected vs. actual type when general.alignment is not u32
- use ggml_nelements() > 0 for the zero-element guard and keep the
  representability checks visually aligned
- add test-gguf cases for a wrong-typed alignment key and a zero-dim
  tensor (both used to crash: assert-abort and SIGFPE respectively)

Ran tests/test-gguf: 164/164 pass. Used an AI assistant to help draft
these edits; reviewed and verified by me.

* cont : less comments

Co-authored-by: Georgi Gerganov <redacted>
---------

Co-authored-by: Georgi Gerganov <redacted>
ggml/src/gguf.cpp
tests/test-gguf.cpp