Skip to content
Permalink
Browse files
Added initialization for unitialized structs
  • Loading branch information
Midren committed Jun 17, 2020
1 parent df289a1 commit f434124dc91c76da59210f0b4c85b2df8a0f021c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
@@ -187,7 +187,7 @@ ErrCode_t msgGenerateMnemonicImpl(GenerateMnemonic *msg, void (*random_buffer_fu
}
}
// random buffer + entropy pool => mix256 => internal entropy
uint8_t data[sizeof(int_entropy)];
uint8_t data[sizeof(int_entropy)] = {0};
random_buffer_func(data, sizeof(data));
entropy_salt_mix_256(data, sizeof(data), int_entropy);
memset(data, 0, sizeof(data));
@@ -180,6 +180,7 @@ msgTransactionSignImpl(TransactionSign *msg, ErrCode_t (*funcConfirmTxn)(char *,
}
#endif
Transaction transaction;
memset(&transaction, 0, sizeof(transaction));
transaction_initZeroTransaction(&transaction);
for (uint32_t i = 0; i < msg->nbIn; ++i) {
uint8_t hashIn[32];
@@ -213,7 +214,7 @@ msgTransactionSignImpl(TransactionSign *msg, ErrCode_t (*funcConfirmTxn)(char *,
if (ret != ErrOk) {
return ret;
}
if (!skycoin_address_from_pubkey(pubkey, address, &size_address)) {
if (!skycoin_address_from_pubkey(pubkey, address, &size_address)) {
return ErrAddressGeneration;
}
if (strcmp(msg->transactionOut[i].address, address) != 0) {

0 comments on commit f434124

Please sign in to comment.