Avoid reference trap in SignatureChecker #5717

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2015_01_avoid_reference_trap changing 1 files +2 −2
  1. laanwj commented at 6:36 AM on January 27, 2015: member

    Fixes #5715. Keeping around references on a class is extremely dangerous, due to C++'s behavior with regard to temporaries. This is a cruel trap for (unwary) programmers. I see two solutions:

    • a) change the argument (and property on SignatureChecker) to a pointer instead of a reference, and manually manage lifetime
    • b) make a copy

    (b) is a one-line change without changes to the interface, so at least for 0.10 has my preference.

    There could be performance impact, but to avoid premature optimization, I'd I'd like to see concrete numbers to warrant a more impactful, error-prone solution.

  2. laanwj added this to the milestone 0.10.0 on Jan 27, 2015
  3. Avoid reference trap in SignatureChecker cff5af9815
  4. laanwj force-pushed on Jan 27, 2015
  5. luke-jr commented at 6:59 AM on January 27, 2015: member

    ACK

  6. laanwj added the label Bug on Jan 27, 2015
  7. laanwj commented at 2:15 PM on January 27, 2015: member

    Closing in favor of #5719

  8. laanwj closed this on Jan 27, 2015

  9. MarcoFalke locked this on Sep 8, 2021

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

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