Handle MoMdepth overflow

This commit is contained in:
jl777
2018-04-27 15:18:28 +03:00
parent 593f9a7075
commit 97343f3d77
2 changed files with 3 additions and 1 deletions

View File

@@ -45,6 +45,8 @@ bits256 iguana_merkle(bits256 *tree,int32_t txn_count)
uint256 komodo_calcMoM(int32_t height,int32_t MoMdepth)
{
static uint256 zero; bits256 MoM,*tree; CBlockIndex *pindex; int32_t i;
if ( MoMdepth >= height )
return(zero);
tree = (bits256 *)calloc(MoMdepth * 3,sizeof(*tree));
for (i=0; i<MoMdepth; i++)
{