From 1d1d4aba65aa6edec94a6d4de1bed92e4cfbafe0 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 7 Mar 2019 13:44:35 +0800 Subject: [PATCH] test zero out mem --- iguana/dpow/dpow_fsm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 2a78e00ce..d4157a6ca 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -637,6 +637,7 @@ void dpow_statemachinestart(void *ptr) { if ( desttx[0] == 0 && rettx[0] != 0 ) { + memset(desttx,0,sizeof(desttx)); // zero out desttx. memcpy(desttx, rettx, strlen(rettx)+1); } if ( dest_confs > 2 ) @@ -653,7 +654,7 @@ void dpow_statemachinestart(void *ptr) send_dest = 1; } } - else if ( desttx[0] != 0 && is_hexstr(desttx,strlen(desttx)) != 0 ) // we have the tranxation hex saved, and the tx is not in the local mempool or a block, so resend it. + else if ( desttx[0] != 0 ) // we have the tranxation hex saved, and the tx is not in the local mempool or a block, so resend it. { fprintf(stderr, "cant find tx.%s rebroadcasting...\n", bits256_str(str,bp->desttxid)); send_dest = 1; @@ -670,6 +671,7 @@ void dpow_statemachinestart(void *ptr) { if ( srctx[0] == 0 && rettx[0] != 0 ) { + memset(srctx,0,sizeof(srctx)); // zero out srctx. memcpy(srctx, rettx, strlen(rettx)+1); } if ( src_confs > 2 )