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

[Net] Fail instead of truncate command name in CMessageHeader #2090

Merged
merged 1 commit into from Jan 22, 2021

Conversation

random-zebra
Copy link

Fix the -Wstringop-truncation warning reported in #2076, cherry-picking the first commit of bitcoin#16995

Replace the memset/strncpy dance in CMessageHeader::CMessageHeader with explicit code that copies then name and asserts the length.

This removes a warning in g++ 9.1.1 and IMO makes the code more readable by not relying on strncpy padding and silent truncation behavior.

Replace the memset/strncpy dance in `CMessageHeader::CMessageHeader`
with explicit code that copies then name and asserts the length.

This removes a warning in g++ 9.1.1 and IMO makes the code more readable
by not relying on strncpy padding and silent truncation behavior.
@random-zebra random-zebra self-assigned this Dec 20, 2020
@random-zebra random-zebra added this to In Progress in perpetual updating PIVX Core to BTC Core via automation Dec 20, 2020
@random-zebra random-zebra added this to the 5.1.0 milestone Jan 17, 2021
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

utACK c223041

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

utACK c223041

perpetual updating PIVX Core to BTC Core automation moved this from In Progress to Ready Jan 22, 2021
@furszy furszy merged commit 198a014 into PIVX-Project:master Jan 22, 2021
perpetual updating PIVX Core to BTC Core automation moved this from Ready to Done Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants