Skip to content

Commit 23dc982

Browse files
MB-60657: Fix integer overflow (#14)
MB-60657: Fix downcast
1 parent 4c2db54 commit 23dc982

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

c_api/index_io_c_ex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using faiss::Index;
1818
using faiss::IndexBinary;
1919

20-
int faiss_write_index_buf(const FaissIndex* idx, int* size, unsigned char** buf) {
20+
int faiss_write_index_buf(const FaissIndex* idx, size_t* size, unsigned char** buf) {
2121
try {
2222
faiss::VectorIOWriter writer;
2323
faiss::write_index(reinterpret_cast<const Index*>(idx), &writer);

c_api/index_io_c_ex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323

2424
/** Write index to buffer
2525
*/
26-
int faiss_write_index_buf(const FaissIndex* idx, int* buf_size, unsigned char** buf);
26+
int faiss_write_index_buf(const FaissIndex* idx, size_t* buf_size, unsigned char** buf);
2727

2828
/** Read index from buffer
2929
*/

0 commit comments

Comments
 (0)