Skip to content
Snippets Groups Projects
Commit 1d8038cd authored by Constantin P.'s avatar Constantin P. 💬
Browse files

Use after free in votings fix

parent 26309e44
No related branches found
No related tags found
1 merge request!1803Use after free in votings fix
Pipeline #44385 passed with stage
in 32 minutes and 30 seconds
......@@ -440,10 +440,10 @@ static int s_vote_verificator(dap_ledger_t *a_ledger, dap_chain_tx_item_type_t a
dap_list_free(l_tsd_list);
// change vote & move it to the end of list
l_voting->votes = dap_list_remove_link(l_voting->votes, it);
DAP_DELETE(it->data);
l_voting->votes = dap_list_append(l_voting->votes, l_vote_item);
char l_vote_hash_str[DAP_HASH_FAST_STR_SIZE];
dap_hash_fast_to_str(&((dap_chain_net_vote_t *)it->data)->vote_hash, l_vote_hash_str, DAP_HASH_FAST_STR_SIZE);
DAP_DELETE(it->data);
log_it(L_INFO, "Vote %s of voting %s has been changed", l_vote_hash_str, dap_hash_fast_to_str_static(&l_voting->voting_hash));
return DAP_LEDGER_CHECK_OK;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment