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

Bug fixes in DataBuffer #791

Merged
merged 13 commits into from
Aug 20, 2024
Merged

Bug fixes in DataBuffer #791

merged 13 commits into from
Aug 20, 2024

Conversation

balazsracz
Copy link
Collaborator

There were several corner cases in appending to a Datauffer that were incorrectly handled and causing crashes in DirectHub.
This PR fixes bugs and adds tests including several fuzz tests for databuffers.

balazsracz added 11 commits July 6, 2024 22:48
Rewrites conditions in move read pointer forward, because it was incorrect.
- Handles the case when the src or dst buffer is empty.
- Detects when the append happens exactly at a buffer boundary and the
  buffers are already linked buffer.
- Adds a parameter that makes this work even when the link is not there yet
This fixes a buffer refcount bug when a buffer ended up with a zero length
and too few refs.
We took over o.free_ but this makes the current buffer appendable, which is wrong.
@balazsracz balazsracz requested a review from bakerstu August 5, 2024 13:26
src/utils/DataBuffer.hxx Outdated Show resolved Hide resolved
src/utils/DataBuffer.hxx Outdated Show resolved Hide resolved
Copy link
Owner

@bakerstu bakerstu left a comment

Choose a reason for hiding this comment

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

Please address @atanisoft comments. I agree with them.

@balazsracz balazsracz merged commit 5b75c8e into master Aug 20, 2024
4 checks passed
@balazsracz balazsracz deleted the bracz-databuffer-fixes branch August 20, 2024 16:11
atanisoft added a commit to atanisoft/OpenMRNIDF that referenced this pull request Aug 20, 2024
balazsracz added a commit that referenced this pull request Aug 20, 2024
* master:
  Bug fixes in DataBuffer (#791)
  Fixes race conditions in HubDeviceSelect. (#795)
  Fixes missing translation of enums when reading the security mode from a simplelink profile. (#796)
  Fixes flaky IfCanStress.test. (#794)
balazsracz added a commit that referenced this pull request Aug 22, 2024
* master:
  Fixes a standards compliance issue with the alias conflict handler. (#793)
  Bug fixes in DataBuffer (#791)
  Fixes race conditions in HubDeviceSelect. (#795)
  Fixes missing translation of enums when reading the security mode from a simplelink profile. (#796)
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.

3 participants