Skip to content

Commit dd562f8

Browse files
committed
pad serialized data with 0s
1 parent 9440b50 commit dd562f8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libsql-sqlite3/src/vectorfloat8.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ void vectorF8SerializeToBlob(
8383
assert( nBlobSize >= vectorDataSize(pVector->type, pVector->dims) );
8484

8585
memcpy(pBlob, pVector->data, pVector->dims);
86+
// pad the blob with 0's, up to the size of the data region defined in `vectorDataSize`
87+
memset(pBlob + pVector->dims, 0, ALIGN(pVector->dims, sizeof(float)) - pVector->dims);
8688

8789
vectorF8GetParameters(pVector->data, pVector->dims, &alpha, &shift);
8890
vectorF8SetParameters(pBlob, pVector->dims, alpha, shift);

0 commit comments

Comments
 (0)