Skip to content

Commit

Permalink
wallet: fix skipping tx dups memory corruption
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schmoock committed Nov 14, 2019
1 parent 1c5c305 commit 69f4cdb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions wallet/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3453,12 +3453,11 @@ struct wallet_transaction *wallet_transactions_get(struct wallet *w, const tal_t
db_column_txid(stmt, 0, &curtxid);

/* If this is a new entry, allocate it in the array and set
* the common fields (all fields from the transactions
* table. */
* the common fields (all fields from the transactions table. */
if (!bitcoin_txid_eq(&last, &curtxid)) {
last = curtxid;
tal_resize(&txs, count + 1);
cur = &txs[count];
tal_resize(&txs, tal_count(txs) + 1);
cur = &txs[tal_count(txs) - 1];
db_column_txid(stmt, 0, &cur->id);
cur->tx = db_column_tx(txs, stmt, 1);
cur->rawtx = tal_dup_arr(txs, u8, db_column_blob(stmt, 1),
Expand Down

0 comments on commit 69f4cdb

Please sign in to comment.