Bugfix: bitcoin-cli: Check length of peer.transport_protocol_type #29657

pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:fix_netinfo_v2t_safety changing 1 files +1 −1
  1. luke-jr commented at 12:35 AM on March 15, 2024: member

    "v" would dereference beyond the string length, and "v10" would show as '1'

    Turn both of these cases into a blank, like anything else unexpected currently is.

  2. Bugfix: bitcoin-cli: Check length of peer.transport_protocol_type c3e632b441
  3. DrahtBot commented at 12:35 AM on March 15, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK sipa, hernanmarino, alfonsoromanz, achow101

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

  4. maflcko commented at 10:20 AM on March 15, 2024: member

    I don't think supporting a malicious server reply in bitcoin-cli is a use case to support. I think just using .at(1) would be fine as well, presumably resulting in a non-UB crash, similar to when the server replies with the wrong type?

  5. luke-jr commented at 12:24 PM on March 17, 2024: member

    Maybe, but this seems cleaner anyway since it also addresses far-future "v10" or such. Any reason to prefer an exception over this?

  6. sipa commented at 3:01 PM on March 17, 2024: member

    utACK c3e632b44153e314ef946f342c68c2758b1cbc4d.

    I wouldn't call it a bugfix, but it does seem slightly better.

  7. hernanmarino commented at 8:17 PM on April 9, 2024: contributor

    utACK c3e632b44153e314ef946f342c68c2758b1cbc4d

  8. alfonsoromanz commented at 7:05 PM on April 15, 2024: contributor

    ACK c3e632b44153e314ef946f342c68c2758b1cbc4d

  9. achow101 commented at 10:04 PM on April 22, 2024: member

    ACK c3e632b44153e314ef946f342c68c2758b1cbc4d

  10. achow101 merged this on Apr 22, 2024
  11. achow101 closed this on Apr 22, 2024

  12. luke-jr referenced this in commit 072dd93ccb on Jun 13, 2024
  13. bitcoin locked this on Apr 22, 2025

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: 2026-04-14 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me