mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-06 05:51:21 +08:00
Improved safety check [skip ci]
This commit is contained in:
@@ -899,7 +899,7 @@ sparsevec_l2_normalize(PG_FUNCTION_ARGS)
|
||||
continue;
|
||||
|
||||
/* Safety check */
|
||||
if (j == newResult->nnz)
|
||||
if (j >= newResult->nnz)
|
||||
elog(ERROR, "safety check failed");
|
||||
|
||||
newResult->indices[j] = result->indices[i];
|
||||
|
||||
Reference in New Issue
Block a user