Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subtractive overflow #314

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cancanyang
Copy link

There is a possibility that currentTimestamp is smaller than oldestTimestamp, creating an overflow and causing normal data to be cleaned up

keyHash := readHashFromEntry(oldestEntry)
if keyHash == 0 || (currentTimestamp >= oldestTimestamp &&
currentTimestamp-oldestTimestamp > s.lifeWindow) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test for it?

@janisz janisz requested a review from cristaloleg April 21, 2022 11:40
@janisz
Copy link
Collaborator

janisz commented Nov 4, 2022

@cancanyang ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants