Improved safety check [skip ci]

This commit is contained in:
Andrew Kane
2024-04-15 14:51:24 -07:00
parent f655166639
commit 2c82f05503

View File

@@ -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];