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

ringbuffer: dif is never less than zero #230

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

Conversation

YutaMiyake
Copy link

@YutaMiyake YutaMiyake commented Apr 27, 2024

Since dif is of type uint64, it can never be less than 0. Instead, when attempting to put an item into a full queue or get an item from an empty queue, dif overflows in the mod calculation manner (e.g., -1 mod 2^64 becomes 18446744073709551615). For clean code, I think it might be better to remove the unreachable code.

@aviary-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@YutaMiyake YutaMiyake marked this pull request as ready for review April 27, 2024 14:35
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