koboldcpp/gguf-py/tests
hcl 5788b510a1
gguf-py: validate n_dims and guard against uint64 overflow in reader (#25401)
The Python GGUF reader lacked two guards the C++ loader has:
- n_dims read as uint32 with no GGML_MAX_DIMS bound -> crafted file with
  huge n_dims triggers oversized memmap read / OOM.
- np.prod(dims) on uint64 wraps silently -> a crafted dims triple can
  overflow to a tiny element count, passing an undersized read through.

Add a GGML_MAX_DIMS check and compute the element count with Python ints.

Fixes #25378
2026-08-04 12:12:48 +03:00
..
__init__.py convert-*.py: GGUF Naming Convention Refactor and Metadata Override Refactor (#7499) 2024-07-18 20:40:15 +10:00
test_gguf_reader_validation.py gguf-py: validate n_dims and guard against uint64 overflow in reader (#25401) 2026-08-04 12:12:48 +03:00
test_metadata.py chore : correct typos [no ci] (#20041) 2026-03-05 08:50:21 +01:00
test_quants.py ggml : add NVFP4 quantization type support (#19769) 2026-03-11 21:02:54 +01:00