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
  1. achow101 commented at 6:32 pm on May 17, 2024: member
    Fixes #30114
  2. 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.

    Type Reviewers
    ACK theStack, laanwj, maflcko

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. laanwj added the label Tests on May 17, 2024
  4. laanwj added the label Wallet on May 17, 2024
  5. wallet, tests: Avoid stringop-overflow warning in PollutePubKey 2289d45240
  6. 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 assert pubkey.size() >= 1 to clarify why it’s importantto the code below.

    achow101 commented at 4:59 pm on May 21, 2024:
    Done
  7. achow101 force-pushed on May 21, 2024
  8. theStack approved
  9. theStack commented at 10:05 am on May 22, 2024: contributor
    utACK 2289d4524053ab71c0d9133987cb36412797c1a2
  10. laanwj approved
  11. laanwj commented at 10:20 am on May 22, 2024: member
    ACK 2289d4524053ab71c0d9133987cb36412797c1a2
  12. maflcko commented at 10:27 am on May 22, 2024: member

    ACK 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==
    
  13. fanquake merged this on May 22, 2024
  14. fanquake 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 site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me