mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-30 01:31:15 +08:00
Improved safety check [skip ci]
This commit is contained in:
@@ -579,7 +579,7 @@ vector_to_sparsevec(PG_FUNCTION_ARGS)
|
||||
if (vec->x[i] != 0)
|
||||
{
|
||||
/* Safety check */
|
||||
if (j == nnz)
|
||||
if (j >= result->nnz)
|
||||
elog(ERROR, "safety check failed");
|
||||
|
||||
result->indices[j] = i + 1;
|
||||
|
||||
Reference in New Issue
Block a user