pgvector.git / summary / log / commit / refs

commit    18b871aa7f208d12f42dbd89f7bf12e30b87bb6b
Author:   Andrew Kane <andrew@ankane.org>
Date:     Wed Jul 29 08:26:33 2026 +0000

    Hardened VECTOR_ARRAY_SIZE [skip ci]


src/ivfflat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ivfflat.h b/src/ivfflat.h index 5620ef9b..9d58b398 100644 --- a/src/ivfflat.h +++ b/src/ivfflat.h @@ -315,7 +315,7 @@ typedef struct IvfflatScanOpaqueData typedef IvfflatScanOpaqueData * IvfflatScanOpaque; -#define VECTOR_ARRAY_SIZE(_length, _size) (sizeof(VectorArrayData) + (_length) * MAXALIGN(_size)) +#define VECTOR_ARRAY_SIZE(_length, _size) add_size(sizeof(VectorArrayData), mul_size(_length, MAXALIGN(_size))) /* Use functions instead of macros to avoid double evaluation */ [parent: 74b0e144c2d9]