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

Use of uninitialized memory in outgoing append entries result frames #183

Merged
merged 3 commits into from
Apr 1, 2024

Conversation

atlesn
Copy link
Contributor

@atlesn atlesn commented Mar 31, 2024

In rejection pathways when receiving append entries or install snapshot frames, the last_log_index field of the internal representation of the append entries result frame was not set. This uninitialized value was then written to the encoding buffer for outgoing append entries result frame and sent out.

Copy link

codecov bot commented Mar 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.09%. Comparing base (dd383c5) to head (9d911c1).
Report is 2 commits behind head on main.

❗ Current head 9d911c1 differs from pull request most recent head 09448e2. Consider uploading reports for the commit 09448e2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #183      +/-   ##
==========================================
- Coverage   74.18%   74.09%   -0.10%     
==========================================
  Files          52       52              
  Lines       10367    10369       +2     
  Branches     2465     2465              
==========================================
- Hits         7691     7683       -8     
- Misses       1321     1330       +9     
- Partials     1355     1356       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@freeekanayaka
Copy link
Member

There are a few rejection paths, do you know exactly which path we're talking about?

It seems that

if (match < 0) {
indeed jumps to the reply label without setting last_log_index, but I'm not sure if there are other paths. If that's the only path, I'd probably suggest to set it there only. That would have the benefit that we don't accidentally mask other cases where we expect that value to be set, but in fact is not.

@atlesn
Copy link
Contributor Author

atlesn commented Apr 1, 2024

I think it's only in the goto reply-case. I moved the initialization to inside the if-statement.

@freeekanayaka
Copy link
Member

I think it's only in the goto reply-case. I moved the initialization to inside the if-statement.

Thanks.

@freeekanayaka freeekanayaka added the downstream Trigger downstream tests label Apr 1, 2024
@freeekanayaka freeekanayaka merged commit e092871 into cowsql:main Apr 1, 2024
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
downstream Trigger downstream tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants