BlockSci icon indicating copy to clipboard operation
BlockSci copied to clipboard

address_from_string("random") causes segmentation fault error

Open yya518 opened this issue 5 years ago • 2 comments

Please provide a clear and concise description of the problem.

Reproduction Steps

import blocksci
addr = chain.address_from_string('random')

If the address str is 'random' or 'Random', it will cause Segmentation fault (core dumped) error. Anything else seems fine. For example addr = chain.address_from_string('x') says

RuntimeError: Tried to construct invalid address

which is as expected.

System Information

Using AMI: no
BlockSci version: 0.6 Blockchain: Bitcoin
Parser: Disk Total memory: 256 GB

yya518 avatar Oct 23 '19 12:10 yya518

not sure what the pattern is. but other words like 'Varies' and 'gememe' also cause segmentation fault (core dumped) error. Is it just me?

yya518 avatar Oct 23 '19 12:10 yya518

With certain short string lengths https://github.com/citp/BlockSci/blob/v0.6/src/scripts/bitcoin_base58.cpp#L224 errors due to vchData being empty. Fixing this should be straightforward.

maltemoeser avatar Oct 25 '19 11:10 maltemoeser