From 73356ecfa720ec5351054fd9c5a68377fdd03260 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 10 Jul 2026 16:30:35 -0700 Subject: [PATCH] Improved check for VectorArrayInit [skip ci] --- src/ivfutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ivfutils.c b/src/ivfutils.c index 690bea9..02e0839 100644 --- a/src/ivfutils.c +++ b/src/ivfutils.c @@ -25,8 +25,8 @@ VectorArrayInit(int maxlen, int dimensions, Size itemsize) { VectorArray res; - if (maxlen < 1 || dimensions < 1) - elog(ERROR, "safety check failed"); + if (maxlen < 1 || dimensions < 1 || itemsize == 0) + elog(ERROR, "cannot create vector array"); /* Ensure items are aligned to prevent UB */ itemsize = MAXALIGN(itemsize);