HomePhabricator

Add basic sanity checking for script pushdata size

Description

Add basic sanity checking for script pushdata size

Summary:
This allowed to uncover several errors in the json test suite.

The checking right now is rather basic, but should catch a good chunk of errors. Actually checking for size when faced with pushdata and when pushing integer literals and/or opcodes. Convertly, we should check that no push is present when no push is expected.

Depends on D1292, Relates to T327

Test Plan:

make check

Added a test for ParseScript. It's barebone for now, but at least cover the functionality added.

Reviewers: #bitcoin_abc, jasonbcox, schancel

Reviewed By: #bitcoin_abc, jasonbcox, schancel

Subscribers: matiu, schancel, jimpo, jasonbcox, teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1293

Details

Provenance
deadalnixAuthored on Apr 16 2018, 20:46
schancelPushed on Apr 19 2018, 00:20
Reviewer
Restricted Project
Differential Revision
D1293: Add basic sanity checking for script pushdata size
Parents
rSTAGINGdbb2998a5996: Add comment on fixing bugs to CONTRIBUTING.md
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/3548, tag: phabricator/base/3546, tag: phabricator/base/3545