rpcwallet.cpp line 3488 may have a null dereference issue #13244

issue fbthrift opened this issue on May 16, 2018
  1. fbthrift commented at 9:15 AM on May 16, 2018: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    version: 0.16.0 source: wallet/rpcwallet.cpp line:3488 else if (pindexStop->nHeight < pindexStart->nHeight) {

    Access to filed 'nHeight' results in a dereference of a null pointer ( loaded from variable 'pindexStart )

    <!--- What behavior did you expect? -->

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    in line 3473, pindexStart = chainActive.Genesis();     CChain::Genesis may return null pointer,
     Because:
        CBlockIndex *Genesis() const {
        return vChain.size() > 0 ? vChain[0] : nullptr;
    }

    when line 3477 not enter into if , pindexStart =NULL ,cause a null deference issue

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. MarcoFalke commented at 2:07 PM on May 16, 2018: member

    The wallet is loaded after the genesis block, no?

  3. fbthrift commented at 2:29 AM on May 17, 2018: none

    yes,genesis return nullptr and var_assigned:pindexStart = NULL;

  4. fbthrift commented at 10:17 AM on May 18, 2018: none

    or I mistake the location of chainActive.Genesis(); ‘s definition’ ?

  5. MarcoFalke commented at 5:55 PM on May 18, 2018: member

    See src/init.cpp, which first loads the chain (genesis) and then the wallet.

  6. MarcoFalke closed this on May 18, 2018

  7. fanquake locked this on Jun 1, 2018
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-29 03:15 UTC

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