Skip to content

Commit

Permalink
fix move right and read off the end of array
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan957 committed Feb 13, 2023
1 parent f496dc4 commit 20010dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cn/kvset_split.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ vblocks_split(

if (!move_left) {
/* Add the vblocks in [boundary, end] to the right kvset */
boundary = overlapping_access ? split : split + 1;
boundary = (overlapping_access || move_right) ? split : split + 1;
for (uint16_t j = boundary; j <= end; j++) {
uint32_t alen;
uint64_t mbid;
Expand Down Expand Up @@ -724,7 +724,7 @@ vblocks_split(
if (!move_right) {
/* Add vblocks in [start, boundary] to the left kvset */
vbcnt = 0; /* reset vbcnt for the left kvset */
boundary = split;
boundary = min(split, end);
for (uint16_t j = start; j <= boundary; j++) {
uint32_t alen;
uint64_t mbid;
Expand Down

0 comments on commit 20010dc

Please sign in to comment.