File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,17 @@ bool CheckBlockSignature(const CBlock& block)
7676 // p2pk scriptsig only contains the signature and p2pkh scriptpubkey only contain the hash.
7777 return false ;
7878 } else {
79- int start = 1 + (int ) *txin.scriptSig .begin (); // skip sig
79+ unsigned int start = 1 + (unsigned int ) *txin.scriptSig .begin (); // skip sig
80+ if (start >= txin.scriptSig .size () - 1 ) return false ;
8081 pubkey = CPubKey (txin.scriptSig .begin ()+start+1 , txin.scriptSig .end ());
8182 }
8283 } else if (whichType == TX_COLDSTAKE) {
8384 // pick the public key from the P2CS input
8485 const CTxIn& txin = block.vtx [1 ]->vin [0 ];
85- int start = 1 + (int ) *txin.scriptSig .begin (); // skip sig
86+ unsigned int start = 1 + (unsigned int ) *txin.scriptSig .begin (); // skip sig
87+ if (start >= txin.scriptSig .size () - 1 ) return false ;
8688 start += 1 + (int ) *(txin.scriptSig .begin ()+start); // skip flag
89+ if (start >= txin.scriptSig .size () - 1 ) return false ;
8790 pubkey = CPubKey (txin.scriptSig .begin ()+start+1 , txin.scriptSig .end ());
8891 }
8992 }
You can’t perform that action at this time.
0 commit comments