From 31762b5922903223f46b2ea06b947c11bd3969f3 Mon Sep 17 00:00:00 2001 From: o7si Date: Thu, 13 Nov 2025 01:05:37 +0800 Subject: [PATCH] fix: correct bounds check in XCDA array access --- src/llama-vocab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-vocab.cpp b/src/llama-vocab.cpp index 735c5d547f9e4..97f374eac9570 100644 --- a/src/llama-vocab.cpp +++ b/src/llama-vocab.cpp @@ -1013,7 +1013,7 @@ struct llm_tokenizer_ugm_session { } private: uint32_t get_node(size_t index) { - if (index > xcda_array_size) { + if (index >= xcda_array_size) { throw std::runtime_error("Index out of array bounds in XCDA array!"); } return xcda_array[index];