瀏覽代碼

vocab : correct bounds check for UGM XCDA array access (#17215)

o7si 2 月之前
父節點
當前提交
ffb6f3d921
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/llama-vocab.cpp

+ 1 - 1
src/llama-vocab.cpp

@@ -1013,7 +1013,7 @@ private:
         }
     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];