Skip to content
Snippets Groups Projects

[*] fixed node segfault while creating vpn-order with no -ext specified

Merged Aleksei Voronin requested to merge bugs-4016 into master
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
@@ -455,9 +455,10 @@ static int s_cli_net_srv( int argc, char **argv, void *arg_func, char **a_str_re
@@ -455,9 +455,10 @@ static int s_cli_net_srv( int argc, char **argv, void *arg_func, char **a_str_re
l_price = (uint64_t) atoll ( l_price_str );
l_price = (uint64_t) atoll ( l_price_str );
l_price_unit.uint32 = (uint32_t) atol ( l_price_unit_str );
l_price_unit.uint32 = (uint32_t) atol ( l_price_unit_str );
strncpy(l_price_token, l_price_token_str, DAP_CHAIN_TICKER_SIZE_MAX - 1);
strncpy(l_price_token, l_price_token_str, DAP_CHAIN_TICKER_SIZE_MAX - 1);
 
size_t l_ext_len = l_ext? strlen(l_ext) + 1 : 0;
char * l_order_new_hash_str = dap_chain_net_srv_order_create(
char * l_order_new_hash_str = dap_chain_net_srv_order_create(
l_net,l_direction, l_srv_uid, l_node_addr,l_tx_cond_hash, l_price, l_price_unit,
l_net,l_direction, l_srv_uid, l_node_addr,l_tx_cond_hash, l_price, l_price_unit,
l_price_token, l_expires, (uint8_t *)l_ext, strlen(l_ext) + 1, l_region_str, l_continent_num);
l_price_token, l_expires, (uint8_t *)l_ext, l_ext_len, l_region_str, l_continent_num);
if (l_order_new_hash_str)
if (l_order_new_hash_str)
dap_string_append_printf( l_string_ret, "Created order %s\n", l_order_new_hash_str);
dap_string_append_printf( l_string_ret, "Created order %s\n", l_order_new_hash_str);
else{
else{
Loading