Auto merge of #4687 - defuse:fix-cscript-test-buffer-overflows, r=daira

Fix buffer overflows in P2PKH tests
This commit is contained in:
Homu 2020-09-03 22:16:23 +00:00
commit 443954580d
1 changed files with 2 additions and 2 deletions

View File

@ -47,12 +47,12 @@ BOOST_AUTO_TEST_CASE(IsPayToPublicKeyHash)
static const unsigned char missing2[] = {
OP_DUP, OP_HASH160, 20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
BOOST_CHECK(!CScript(missing2, missing2+sizeof(missing)).IsPayToPublicKeyHash());
BOOST_CHECK(!CScript(missing2, missing2+sizeof(missing2)).IsPayToPublicKeyHash());
static const unsigned char tooshort[] = {
OP_DUP, OP_HASH160, 2, 0,0, OP_EQUALVERIFY, OP_CHECKSIG
};
BOOST_CHECK(!CScript(tooshort, tooshort+sizeof(direct)).IsPayToPublicKeyHash());
BOOST_CHECK(!CScript(tooshort, tooshort+sizeof(tooshort)).IsPayToPublicKeyHash());
}