From 2c82f05503ff977480e0c2874d641d7c83fff761 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 15 Apr 2024 14:51:24 -0700 Subject: [PATCH] Improved safety check [skip ci] --- src/sparsevec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sparsevec.c b/src/sparsevec.c index 6f6d73f..6c1949f 100644 --- a/src/sparsevec.c +++ b/src/sparsevec.c @@ -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];