Bugfix: Don't save temporary pointer in CBigNum::SetHex #1934

pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:bugfix_bignum_tmp changing 1 files +6 −2
  1. luke-jr commented at 3:21 PM on October 15, 2012: member

    No description provided.

  2. Bugfix: Don't save temporary pointer in CBigNum::SetHex 851e8203af
  3. sipa commented at 3:23 PM on October 15, 2012: member

    I don't see why this is a bugfix. The result of c_str is guaranteed to remain accessible as long as the backing string isn't modified.

  4. luke-jr commented at 3:38 PM on October 15, 2012: member

    Hmm, didn't know that. Okay.

  5. luke-jr closed this on Oct 15, 2012

  6. laanwj commented at 4:09 PM on October 15, 2012: member

    I agree that in general it's bad form to store the result of c_str(), as it makes for fragile code, but in this case it's a constant parameter so it's ok.

  7. KolbyML referenced this in commit c576916cf2 on Dec 5, 2020
  8. DrahtBot locked this on Sep 8, 2021
Contributors

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:16 UTC

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