Skip to content

Commit

Permalink
Fix: Dumping to uninitialized memory in Java
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Nov 13, 2023
1 parent 25dc6fc commit 9eaa10d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ JNIEXPORT jintArray JNICALL Java_cloud_unum_usearch_Index_c_1search( //
search_result_t result =
reinterpret_cast<index_dense_t*>(c_ptr)->search(vector_span, static_cast<std::size_t>(wanted));
if (result) {
std::size_t found = result.dump_to(reinterpret_cast<vector_key_t*>(matches_data), NULL);
std::size_t found = result.dump_to(reinterpret_cast<vector_key_t*>(matches_data));
(*env).SetIntArrayRegion(matches, 0, found, matches_data);
} else {
jclass jc = (*env).FindClass("java/lang/Error");
Expand Down

0 comments on commit 9eaa10d

Please sign in to comment.