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 time comparison overflow #288

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Fix time comparison overflow #288

merged 1 commit into from
Jun 4, 2024

Conversation

archigup
Copy link
Member

@archigup archigup commented Jun 3, 2024

Fix time comparison in sendBuffer after overflow

Description

Fixes #286

Previously, a time overflow could cause the comparison to fail, and cause a
failed sendBuffer. Now, the code compares against the duration rather than
against the specific timepoint. Since signed overflow/underflow is defined,
subtracting to get the duration is okay as long as the duration fits in the
integer type.

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

#286

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@archigup archigup merged commit e40e9a3 into FreeRTOS:main Jun 4, 2024
11 checks passed
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.

sendBuffer may fail because of tick timer rollover
3 participants