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