Skip to content

Fix subtractive overflow#314

Open
cancanyang wants to merge 1 commit intoallegro:mainfrom
cancanyang:fix-overflow
Open

Fix subtractive overflow#314
cancanyang wants to merge 1 commit intoallegro:mainfrom
cancanyang:fix-overflow

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