Skip to content

Commit

Permalink
Protect variable has() check against table out of bounds return
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrismarsh committed Jun 12, 2024
1 parent cdabe13 commit 7d2d6be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/timeseries/variablestorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ bool variablestorage<T>::has(const uint64_t& hash)

// did the table return garbage?
//mphf might return an index, but it isn't actually what we want. double check the hash
if(_variables[idx].xxhash != hash)
if(idx > _variables.size() ||
_variables[idx].xxhash != hash)
{
return false;
}

return true;
}
Expand Down

0 comments on commit 7d2d6be

Please sign in to comment.