mirror of
https://github.com/pgvector/pgvector.git
synced 2026-12-05 08:48:38 +00:00
Hardened VectorArraySet [skip ci]
This commit is contained in:
1 parent
586e7515ba
commit
a0eaf70d17
1 file changed
+6
-1
+6
-1
@@ -309,7 +309,12 @@ VectorArrayGet(VectorArray arr, int offset)
|
||||
static inline void
|
||||
VectorArraySet(VectorArray arr, int offset, Pointer val)
|
||||
{
|
||||
memcpy(VectorArrayGet(arr, offset), val, VARSIZE_ANY(val));
|
||||
Size size = VARSIZE_ANY(val);
|
||||
|
||||
if (size > arr->itemsize)
|
||||
elog(ERROR, "safety check failed");
|
||||
|
||||
memcpy(VectorArrayGet(arr, offset), val, size);
|
||||
}
|
||||
|
||||
/* Methods */
|
||||
|
||||
Reference in new issue
Block a user