diff --git a/modules/common/dap_chain_common.c b/modules/common/dap_chain_common.c index 963405a476135ebb75d41e2f2217db47c9408b75..2491c7b8d86107eadeebc7814c2406e88c6d9082 100644 --- a/modules/common/dap_chain_common.c +++ b/modules/common/dap_chain_common.c @@ -765,8 +765,11 @@ uint256_t dap_cvt_str_to_uint256(const char *a_256bit_num) int l_exp_len = l_eptr - a_256bit_num - l_dot_len - 1; if (l_exp_len + l_dot_len + 1 >= SZ_MAX256SCINOT) return log_it(L_ERROR, "Too many digits in '%s'", a_256bit_num), uint256_0; - if (l_exp < l_exp_len) - return log_it(L_ERROR, "Invalid number format with exponent %d and nuber coun after dot %d", l_exp, l_exp_len), uint256_0; + if (l_exp < l_exp_len) { + //todo: we need to handle numbers like 1.23456789000000e9 + return log_it(L_ERROR, "Invalid number format with exponent %d and nuber coun after dot %d", l_exp, + l_exp_len), uint256_0; + } memcpy(l_256bit_num, a_256bit_num, l_dot_len); memcpy(l_256bit_num + l_dot_len, a_256bit_num + l_dot_len + 1, l_exp_len); int l_zero_cnt = l_exp - l_exp_len;