Skip to content

Commit

Permalink
fix: coap psk_id init error
Browse files Browse the repository at this point in the history
  • Loading branch information
willssong committed Sep 30, 2022
1 parent 13a5bf2 commit 0746d2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdk_src/protocol/coap/coap_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ int qcloud_iot_coap_init(CoAPClient *pClient, CoAPInitParams *pParams)
pClient->network_stack.ssl_connect_params.ca_crt_len = strlen(pClient->network_stack.ssl_connect_params.ca_crt);

#else
pClient->network_stack.ssl_connect_params.psk_id = pClient->device_info.client_id;
strncpy(pClient->network_stack.ssl_connect_params.psk_id, pClient->device_info.client_id, MAX_SIZE_OF_CLIENT_ID);
pClient->network_stack.ssl_connect_params.psk_id[MAX_SIZE_OF_CLIENT_ID] = '\0';
if (pParams->device_secret != NULL) {
size_t src_len = strlen(pParams->device_secret);
size_t len;
Expand Down

0 comments on commit 0746d2f

Please sign in to comment.