RPC 'sendfrom' with invalid address crashes bitcoind #447

issue dooglus opened this issue on August 3, 2011
  1. dooglus commented at 7:59 AM on August 3, 2011: contributor

    $ bitcoind sendfrom '' a1 1 error: no response from server

    I compiled with debugging, and it crashed on an assert() in bash58.h: #2 0x00000037510296e6 in __assert_fail () from /lib64/libc.so.6 #3 0x00000000004dd82e in CBitcoinAddress::GetHash160 (this=0x41801170)

    at base58.h:300
    

    #4 0x00000000004dd886 in CScript::SetBitcoinAddress (this=0x41800e40,

    address=...) at script.h:643
    

    #5 0x00000000004ca57d in CWallet::SendMoneyToBitcoinAddress (this=0x1276e70,

    address=..., nValue=1, wtxNew=..., fAskFee=false) at wallet.cpp:1122
    

    #6 0x00000000004f7c42 in sendfrom (params=..., fHelp=false) at rpc.cpp:834 #7 0x00000000004fec0c in ThreadRPCServer2 (parg=0x0) at rpc.cpp:2232

    Do we need to check address.IsValid() in rpc.cpp before calling SendMoneyToBitcoinAddress()?

    I think other RPC calls which take an address have the same problem too.

  2. laanwj commented at 6:56 PM on December 3, 2011: member

    I cannot reproduce this with the current version of bitcoin:

    $ ./bitcoind sendfrom '' a1 1
    error: {"code":-5,"message":"Invalid bitcoin address"}
    

    So I'm closing this issue. If you can still produce this with release 0.5.0 or later, please re-open the issue.

  3. laanwj closed this on Dec 3, 2011

  4. luke-jr commented at 4:22 PM on December 5, 2011: member

    FWIW, confirmed this issue does not affect bitcoind git 0.4.x branch at commit ba56a88.

  5. dexX7 referenced this in commit 9f2275a1c2 on Jan 9, 2017
  6. ptschip referenced this in commit 715e68b530 on Apr 19, 2017
  7. kallewoof referenced this in commit 866da4496b on Oct 4, 2019
  8. KolbyML referenced this in commit bc86927231 on Sep 4, 2020
  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 18:16 UTC

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