Skip to content

Commit

Permalink
Merge pull request #193 from vgteam/uninit-read
Browse files Browse the repository at this point in the history
Prevent uninitialized memory read during PackedPathPositionOverlay construction
  • Loading branch information
jeizenga authored Nov 22, 2023
2 parents 76cb9d1 + dfd03e8 commit a63bcee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bdsg/src/packed_path_position_overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,12 @@ step_handle_t BBHashHelper::iterator::operator*() const {
bool BBHashHelper::iterator::operator==(const BBHashHelper::iterator& other) const {
// on the end iterator, we don't care what the step is, only that we're past-the-last
// path handle
return (iteratee == other.iteratee
&& path_handle_idx == other.path_handle_idx
&& (step == other.step || path_handle_idx == iteratee->path_handles.size()));
if (iteratee == other.iteratee && path_handle_idx == other.path_handle_idx) {
if (path_handle_idx == iteratee->path_handles.size() || step == other.step) {
return true;
}
}
return false;
}

bool BBHashHelper::iterator::operator!=(const BBHashHelper::iterator& other) const {
Expand Down

0 comments on commit a63bcee

Please sign in to comment.