Skip to content

Conversation

@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Mar 8, 2017

Prior to this commit:

bench/checkblock.cpp:41:5: warning: Function call argument is a pointer to uninitialized value [clang-analyzer-core.CallAndMessage]
    stream.write(&a, 1); // Prevent compaction

Copy link
Member

Choose a reason for hiding this comment

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

A NUL terminator is unnecessary here, as the array is not interpreted as a string.

Copy link
Member

Choose a reason for hiding this comment

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

ACK on this change

@practicalswift practicalswift force-pushed the avoid-pointers-to-unitialized-values-in-function-calls branch from 4c5671f to 218d915 Compare March 8, 2017 15:40
@practicalswift
Copy link
Contributor Author

@laanwj Thanks for the quick review! This PR is now limited to fixing the two uninitialized values in src/bench/checkblock.cpp.

@paveljanik
Copy link
Contributor

ACK 218d915

@maflcko
Copy link
Member

maflcko commented Mar 8, 2017 via email

@TheBlueMatt
Copy link
Contributor

@MarcoFalke it looks like these are read, however (well, copied and never acted on, but still technically undefined behavior).

utACK 218d915

@fanquake fanquake added the Tests label Mar 9, 2017
@practicalswift
Copy link
Contributor Author

Adding link to "Always initialize an object" (ES.20) in the C++ Core Guidelines.

@laanwj laanwj merged commit 218d915 into bitcoin:master Apr 10, 2017
laanwj added a commit that referenced this pull request Apr 10, 2017
… to uninitialized values

218d915 [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift)

Tree-SHA512: 68d62e9442094f171433291b7f13dba20fc7ead5fd7f2292e1eb97ae51aa2345d40224c4a65c2e5d3552802b3cd0f675a82b6181cf5b77e964355650b25089f0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request May 20, 2019
…ointers to uninitialized values

218d915 [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift)

Tree-SHA512: 68d62e9442094f171433291b7f13dba20fc7ead5fd7f2292e1eb97ae51aa2345d40224c4a65c2e5d3552802b3cd0f675a82b6181cf5b77e964355650b25089f0
markblundeberg pushed a commit to markblundeberg/bitcoin-abc that referenced this pull request Jun 15, 2019
… to uninitialized values

Summary:
218d915 [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift)

Tree-SHA512: 68d62e9442094f171433291b7f13dba20fc7ead5fd7f2292e1eb97ae51aa2345d40224c4a65c2e5d3552802b3cd0f675a82b6181cf5b77e964355650b25089f0

Backport of Core PR9949
bitcoin/bitcoin#9949

Test Plan:
  make check

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3324
jtoomim pushed a commit to jtoomim/bitcoin-abc that referenced this pull request Jun 29, 2019
… to uninitialized values

Summary:
218d915 [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift)

Tree-SHA512: 68d62e9442094f171433291b7f13dba20fc7ead5fd7f2292e1eb97ae51aa2345d40224c4a65c2e5d3552802b3cd0f675a82b6181cf5b77e964355650b25089f0

Backport of Core PR9949
bitcoin/bitcoin#9949

Test Plan:
  make check

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3324
jonspock pushed a commit to devaultcrypto/devault that referenced this pull request Jul 5, 2019
… to uninitialized values

Summary:
218d915 [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift)

Tree-SHA512: 68d62e9442094f171433291b7f13dba20fc7ead5fd7f2292e1eb97ae51aa2345d40224c4a65c2e5d3552802b3cd0f675a82b6181cf5b77e964355650b25089f0

Backport of Core PR9949
bitcoin/bitcoin#9949

Test Plan:
  make check

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3324
jonspock pushed a commit to devaultcrypto/devault that referenced this pull request Jul 9, 2019
… to uninitialized values

Summary:
218d915 [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift)

Tree-SHA512: 68d62e9442094f171433291b7f13dba20fc7ead5fd7f2292e1eb97ae51aa2345d40224c4a65c2e5d3552802b3cd0f675a82b6181cf5b77e964355650b25089f0

Backport of Core PR9949
bitcoin/bitcoin#9949

Test Plan:
  make check

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3324
@practicalswift practicalswift deleted the avoid-pointers-to-unitialized-values-in-function-calls branch April 10, 2021 19:30
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants