Skip to content

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 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

@furszy furszy merged commit 198a014 into PIVX-Project:master Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants