Commit 7cf75c6d authored by Dong Anyuan's avatar Dong Anyuan

Fix Coverity Scan CID 60277 (Calling strncpy with a maximum size argument of...

Fix Coverity Scan CID 60277 (Calling strncpy with a maximum size argument of 4096 bytes on destination array user_api_id->recv_buffer of size 4096 bytes might leave the destination string unterminated.)
parent 4eb03447
...@@ -276,7 +276,7 @@ int user_api_set_data(user_api_id_t *user_api_id, char *message) ...@@ -276,7 +276,7 @@ int user_api_set_data(user_api_id_t *user_api_id, char *message)
memset(user_api_id->recv_buffer, 0, USER_API_RECV_BUFFER_SIZE); memset(user_api_id->recv_buffer, 0, USER_API_RECV_BUFFER_SIZE);
strncpy(user_api_id->recv_buffer, message, USER_API_RECV_BUFFER_SIZE); strncpy(user_api_id->recv_buffer, message, USER_API_RECV_BUFFER_SIZE - 1);
rbytes = strlen(user_api_id->recv_buffer); rbytes = strlen(user_api_id->recv_buffer);
LOG_TRACE(INFO, "USR-API - %d bytes write", rbytes); LOG_TRACE(INFO, "USR-API - %d bytes write", rbytes);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment