Skip to content

Commit

Permalink
Fix crash in non-neighbor point
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanhaoji2 committed Jul 29, 2024
1 parent f9d0c97 commit 1c9904a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/in_mem_static_graph_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ std::tuple<uint32_t, uint32_t, size_t> InMemStaticGraphStore::load_impl(const st

// first round to calculate memory size needed.
size_t cur_index = 0;
while (cur_index + sizeof(uint32_t) < graph_size)
while (cur_index + sizeof(uint32_t) <= graph_size)
{
uint32_t k;
memcpy((char*)&k, buffer.data() + cur_index, sizeof(uint32_t));
Expand All @@ -150,7 +150,7 @@ std::tuple<uint32_t, uint32_t, size_t> InMemStaticGraphStore::load_impl(const st
// second round to insert graph data
nodes_read = 0;
cur_index = 0;
while (cur_index + sizeof(uint32_t) < graph_size)
while (cur_index + sizeof(uint32_t) <= graph_size)
{
uint32_t k;
memcpy((char*)&k, buffer.data() + cur_index, sizeof(uint32_t));
Expand Down

0 comments on commit 1c9904a

Please sign in to comment.