Skip to content
Snippets Groups Projects
Commit 5d97253c authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files

Merge branch 'develop' of https://gitlab.demlabs.net/cellframe/cellframe-sdk into develop

parents 60aabe4d 1a357bc1
No related branches found
No related tags found
2 merge requests!251Master,!250Master
...@@ -69,8 +69,16 @@ static void dap_app_cli_http_read(uint64_t *socket, dap_app_cli_cmd_state_t *l_c ...@@ -69,8 +69,16 @@ static void dap_app_cli_http_read(uint64_t *socket, dap_app_cli_cmd_state_t *l_c
l_cmd->cmd_res_len = atoi(l_str_ptr + strlen(l_cont_len_str)); l_cmd->cmd_res_len = atoi(l_str_ptr + strlen(l_cont_len_str));
if (l_cmd->cmd_res_len == 0) { if (l_cmd->cmd_res_len == 0) {
s_status = DAP_CLI_ERROR_FORMAT; s_status = DAP_CLI_ERROR_FORMAT;
} else { }
else {
s_status++; s_status++;
// resize buffer for received data
if (l_cmd->cmd_res_len > l_cmd->cmd_res_len_max) {
size_t l_len_max = l_cmd->cmd_res_len_max;
l_cmd->cmd_res_len_max = l_cmd->cmd_res_len + 1;
l_cmd->cmd_res = DAP_REALLOC(l_cmd->cmd_res, l_cmd->cmd_res_len_max);
memset(l_cmd->cmd_res + l_len_max, 0, l_cmd->cmd_res_len_max - l_len_max);
}
} }
} else { } else {
break; break;
......
...@@ -34,6 +34,7 @@ typedef struct dap_app_cli_cmd_state { ...@@ -34,6 +34,7 @@ typedef struct dap_app_cli_cmd_state {
int ret_code; int ret_code;
// for reply // for reply
char *cmd_res; char *cmd_res;
size_t cmd_res_len_max;
size_t cmd_res_len; size_t cmd_res_len;
size_t cmd_res_cur; size_t cmd_res_cur;
} dap_app_cli_cmd_state_t; } dap_app_cli_cmd_state_t;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment