Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Avoid returning a BIP9Stats object with uninitialized values #10957
+1
−1
Conversation
practicalswift
changed the title from
Do not return a BIP9Stats object with uninitialized values
to
Avoid returning a BIP9Stats object with uninitialized values
Jul 30, 2017
|
utACK bf2f4c3 |
|
utACK thanks! I think this would only apply to the genesis block, right? Which would never be |
| @@ -112,8 +112,12 @@ BIP9Stats AbstractThresholdConditionChecker::GetStateStatisticsFor(const CBlockI | ||
| stats.period = Period(params); | ||
| stats.threshold = Threshold(params); | ||
| - if (pindex == NULL) | ||
| + if (pindex == NULL) { | ||
| + stats.elapsed = 0; |
promag
Jul 31, 2017
Contributor
I see no problem in:
- moving all default values to
BIP9Statsconstructor, or - moving these up even if they are overwritten below.
|
Or maybe just initialize the stats object with an = {}? |
|
@TheBlueMatt Thanks for the review! Fixed! :-) |
jonasschnelli
added
the
Refactoring
label
Aug 3, 2017
|
utACK 3eb53b8 |
|
utACK 3eb53b8 |
|
utACK |
|
trivialACK 3eb53b8 |
MarcoFalke
merged commit 3eb53b8
into
bitcoin:master
Aug 16, 2017
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
added a commit
that referenced
this pull request
Aug 16, 2017
added a commit
to MarcoFalke/bitcoin
that referenced
this pull request
Oct 3, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
practicalswift commentedJul 30, 2017
•
Edited 1 time
-
practicalswift
Jul 30, 2017
Uninitialized data potentially used in
rpc/blockchain.cpp:Friendly ping @pinheadmz :-)