BUGFIX: Stack around the variable 'rv' was corrupted #5884

pull fsb4000 wants to merge 1 commits into bitcoin:master from fsb4000:patch-2 changing 1 files +2 −2
  1. fsb4000 commented at 2:26 PM on March 12, 2015: contributor

    The bug had appeared here: https://github.com/bitcoin/bitcoin/commit/bfc6070342b9f43bcf125526e6a3c8ed34e29a71

    https://github.com/bitcoin/bitcoin/commit/bfc6070342b9f43bcf125526e6a3c8ed34e29a71#diff-23a5eb4be66c42bad04bf3742c952bf9L26

    We changed WIDTH (new WIDTH = old WIDTH * 4) but we didn't change the usage of WIDTH.

    I found the bug after launch unit tests in Debug Mode.(the bug appears if tests are compiled in Debug Mode, if tests are compiled in Release Mode the bug doesn't appear)

    Running 148 test cases...
    unknown location(0): fatal error in "basics": (0) : Run-Time Check Failure [#2](/bitcoin-bitcoin/2/) - Stack around the variable 'rv' was corrupted.
    c:\myprojects\bitcoin\src\test\uint256_tests.cpp(119): last checkpoint
    
    *** 1 failure detected in test suite "Bitcoin Test Suite"
    
  2. laanwj commented at 3:49 PM on March 12, 2015: member

    Good catch, ACK

  3. sipa commented at 3:53 PM on March 12, 2015: member

    ACK.

    The same thing needs to be done with the WIDTH reference in uint256::GetHash() (though it's not a problem there).

  4. laanwj added the label Priority High on Mar 12, 2015
  5. BUGFIX: Stack around the variable 'rv' was corrupted e96c5184e7
  6. fsb4000 commented at 4:18 PM on March 12, 2015: contributor

    @sipa

    The same thing needs to be done with the WIDTH reference in uint256::GetHash() (though it's not a problem there).

    Done

  7. sipa commented at 4:19 PM on March 12, 2015: member

    ACK

  8. laanwj merged this on Mar 12, 2015
  9. laanwj closed this on Mar 12, 2015

  10. laanwj referenced this in commit 7077fe6dd4 on Mar 12, 2015
  11. fsb4000 deleted the branch on Mar 13, 2015
  12. 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-19 03:15 UTC

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