From ad5a862e4823c8d0c25887b0181db8012079c97c Mon Sep 17 00:00:00 2001 From: "oljas.jarasbaev" <oljas.jarasbaev@demlabs.net> Date: Tue, 12 Mar 2024 12:29:58 +0000 Subject: [PATCH] Feature 10421 rc --- modules/common/include/dap_chain_common.h | 2 +- modules/wallet/dap_chain_wallet.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/common/include/dap_chain_common.h b/modules/common/include/dap_chain_common.h index 0e6e94f069..109d128d70 100644 --- a/modules/common/include/dap_chain_common.h +++ b/modules/common/include/dap_chain_common.h @@ -249,7 +249,7 @@ DAP_STATIC_INLINE uint256_t dap_chain_uint256_from_uint128(uint128_t a_from) } #define dap_chain_balance_print dap_uint256_uninteger_to_char -#define dap_chain_balance_scan dap_uint256_scan_uninteger +#define dap_chain_balance_scan(a_balance) (strchr(a_balance, '.') && !strchr(a_balance, '+')) ? dap_uint256_scan_decimal(a_balance) : dap_uint256_scan_uninteger(a_balance) #define dap_chain_balance_to_coins dap_uint256_decimal_to_char #define dap_chain_coins_to_balance dap_uint256_scan_decimal #define dap_chain_uint256_to dap_uint256_to_uint64 diff --git a/modules/wallet/dap_chain_wallet.c b/modules/wallet/dap_chain_wallet.c index 124be73e09..b504530cf6 100644 --- a/modules/wallet/dap_chain_wallet.c +++ b/modules/wallet/dap_chain_wallet.c @@ -59,6 +59,7 @@ #include "dap_enc_key.h" #include "crc32c_adler.h" #include "dap_chain_ledger.h" +#include "dap_strfuncs.h" //#define __USE_GNU @@ -953,7 +954,7 @@ ssize_t l_rc, l_pass_len; if ( (l_cp = strstr(a_wallet_name, s_wallet_ext)) ) strncpy(l_wallet_name, a_wallet_name, l_cp - a_wallet_name); - else strcpy(l_wallet_name, a_wallet_name); + else strncpy(l_wallet_name, a_wallet_name, sizeof(l_wallet_name)-1); snprintf(l_file_name, sizeof(l_file_name) - 1, "%s/%s%s", a_wallets_path, l_wallet_name, s_wallet_ext); -- GitLab