]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
fix: OOB reads in UGM tokenizer (precompiled_charsmap handling) (#18750)
authorhourhl <redacted>
Wed, 8 Jul 2026 05:02:09 +0000 (13:02 +0800)
committerGitHub <redacted>
Wed, 8 Jul 2026 05:02:09 +0000 (08:02 +0300)
commit4a7ee3126d529618b330269f7a68c53d1ca012c1
tree6dfab75358a602c6b343eeab63fe9dd2b3f7cea2
parent57b50e1f6b50e01eb14c43fc1253602af74c1870
fix: OOB reads in UGM tokenizer (precompiled_charsmap handling) (#18750)

* fix: OOB reads in UGM tokenizer (precompiled_charsmap handling)

- Validate minimum size (4 bytes) before reading xcda_blob_size
- Use strnlen with bounds check instead of unsafe strlen

Both issues allow heap-buffer-overflow from malicious T5/UGM GGUF files.

* Replace unsafe strnlen() with a bounds-checked loop that scans for \0 within the remaining array size.

* move bounds checks to load

* typo merge fix

---------

Co-authored-by: hourhl <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
src/llama-vocab.cpp