Fix crash in importwallet and dumpwallet formatting #3691

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2014_02_importwallet_fix changing 1 files +3 −3
  1. laanwj commented at 10:39 AM on February 17, 2014: member
    • DecodeDumpTime was passing a statically allocated facet object to std::locale. However, "The constructed locale object takes over responsibility for deleting this facet object." causing a free() crash on scope exit. Fixes #3670.
    • EncodeDumpTime was using the wrong format character for dates (appears accidentally introduced in 51ed9ec9)
  2. BitcoinPullTester commented at 11:13 AM on February 17, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/0f533aca90665dbb8e3246947df738da2136c2c6 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  3. jgarzik commented at 1:58 PM on February 17, 2014: contributor

    ACK

  4. in src/rpcdump.cpp:None in 0f533aca90 outdated
      30 |  int64_t static DecodeDumpTime(const std::string &str) {
      31 | -    static boost::posix_time::time_input_facet facet("%Y-%m-%dT%H:%M:%SZ");
      32 |      static const boost::posix_time::ptime epoch = boost::posix_time::from_time_t(0);
      33 | -    const std::locale loc(std::locale::classic(), &facet);
      34 | +    static const std::locale loc(std::locale::classic(),
      35 | +            new boost::posix_time::time_input_facet("%Y-%m-%dT%H:%M:%SZ"));
    


    Diapolo commented at 3:11 PM on February 17, 2014:

    Indentation-nit :-P

  5. gavinandresen commented at 5:09 PM on February 17, 2014: contributor

    ACK

  6. Fix crash in importwallet and dumpwallet formatting
    - DecodeDumpTime was passing a statically allocated facet object to
      std::locale. However, "The constructed locale object takes over
      responsibility for deleting this facet object." causing a free()
      crash on scope exit. Fixes #3670.
    
    - EncodeDumpTime was using the wrong format character for dates
      (appears accidentally introduced in 51ed9ec9)
    a143d4ce58
  7. laanwj commented at 5:43 PM on February 17, 2014: member

    @diapolo "fixed" indentation

  8. laanwj referenced this in commit 0a0cf14337 on Feb 17, 2014
  9. laanwj merged this on Feb 17, 2014
  10. laanwj closed this on Feb 17, 2014

  11. laanwj deleted the branch on Apr 9, 2014
  12. DrahtBot 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:16 UTC

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