Improved safety check [skip ci]

This commit is contained in:
Andrew Kane committed 2024-04-15 14:55:32 -07:00
1 parent 2c82f05503
commit bf3ef4de56
1 file changed
+1 -1
+1 -1
View File
@@ -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;