ParseScript accept malformed scripts that push an invalid amount of data.
Notably the following is not checked at this point in time:
- That data is actually pushed when a push is expected.
- That push using OP_PUSHDATA1, OP_PUSHDATA2 and OP_PUSHDATA4 are actually the proper size.
- That no data is pushed when no push is expected.
D1293 updates it to do basic checking on the data being pushed, but do not quite check everything it should. However it can be used as a model to resolve this task.