wallet, tests: Avoid stringop-overflow warning in PollutePubKey #30131
pull achow101 wants to merge 1 commits into bitcoin:master from achow101:fix-pollutpubkey-stringop-overflow changing 1 files +4 −2-
achow101 commented at 6:32 pm on May 17, 2024: memberFixes #30114
-
DrahtBot commented at 6:32 pm on May 17, 2024: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage
For detailed information about the code coverage, see the test coverage report.
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
-
laanwj added the label Tests on May 17, 2024
-
laanwj added the label Wallet on May 17, 2024
-
wallet, tests: Avoid stringop-overflow warning in PollutePubKey 2289d45240
-
in src/wallet/test/wallet_tests.cpp:502 in dd18fe6b99 outdated
498@@ -499,8 +499,10 @@ static void TestWatchOnlyPubKey(LegacyScriptPubKeyMan* spk_man, const CPubKey& a 499 // Cryptographically invalidate a PubKey whilst keeping length and first byte 500 static void PollutePubKey(CPubKey& pubkey) 501 { 502- std::vector<unsigned char> pubkey_raw(pubkey.begin(), pubkey.end()); 503- std::fill(pubkey_raw.begin()+1, pubkey_raw.end(), 0); 504+ assert(pubkey.IsValid());
laanwj commented at 3:52 am on May 18, 2024:Maybe directly assertpubkey.size() >= 1
to clarify why it’s importantto the code below.
achow101 commented at 4:59 pm on May 21, 2024:Doneachow101 force-pushed on May 21, 2024theStack approvedtheStack commented at 10:05 am on May 22, 2024: contributorutACK 2289d4524053ab71c0d9133987cb36412797c1a2laanwj approvedlaanwj commented at 10:20 am on May 22, 2024: memberACK 2289d4524053ab71c0d9133987cb36412797c1a2maflcko commented at 10:27 am on May 22, 2024: memberACK 2289d4524053ab71c0d9133987cb36412797c1a2 with g++ 14.1.1 🦄
Signature:
0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" 1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= 2trusted comment: ACK 2289d4524053ab71c0d9133987cb36412797c1a2 with g++ 14.1.1 🦄 3TjtmKQsXUYiFgTCuw6z0Tax+TbeKHJD9b3u0Dnwie7qSiCyzVNoZlQqwcXbzDua+DyPjZF++qIzEMC11iFEDCQ==
fanquake merged this on May 22, 2024fanquake closed this on May 22, 2024
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 09:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 09:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me