diff --git a/source/core_http_client.c b/source/core_http_client.c index 9bcfdf3e..17a23df0 100644 --- a/source/core_http_client.c +++ b/source/core_http_client.c @@ -1416,9 +1416,9 @@ static HTTPStatus_t addRangeHeader( HTTPRequestHeaders_t * pRequestHeaders, /* Generate the value data for the Range Request header.*/ /* Write the range value prefix in the buffer. */ - ( void ) strncpy( rangeValueBuffer, - HTTP_RANGE_REQUEST_HEADER_VALUE_PREFIX, - HTTP_RANGE_REQUEST_HEADER_VALUE_PREFIX_LEN ); + ( void ) memcpy( rangeValueBuffer, + HTTP_RANGE_REQUEST_HEADER_VALUE_PREFIX, + HTTP_RANGE_REQUEST_HEADER_VALUE_PREFIX_LEN ); rangeValueLength += HTTP_RANGE_REQUEST_HEADER_VALUE_PREFIX_LEN; /* Write the range start value in the buffer. */ @@ -1496,7 +1496,7 @@ static HTTPStatus_t writeRequestLine( HTTPRequestHeaders_t * pRequestHeaders, if( returnStatus == HTTPSuccess ) { /* Write " HTTP/1.1\r\n" to start the HTTP header. */ - ( void ) strncpy( pBufferCur, pMethod, methodLen ); + ( void ) memcpy( pBufferCur, pMethod, methodLen ); pBufferCur += methodLen; *pBufferCur = SPACE_CHARACTER; @@ -1505,23 +1505,23 @@ static HTTPStatus_t writeRequestLine( HTTPRequestHeaders_t * pRequestHeaders, /* Use "/" as default value if is NULL. */ if( ( pPath == NULL ) || ( pathLen == 0U ) ) { - ( void ) strncpy( pBufferCur, - HTTP_EMPTY_PATH, - HTTP_EMPTY_PATH_LEN ); + ( void ) memcpy( pBufferCur, + HTTP_EMPTY_PATH, + HTTP_EMPTY_PATH_LEN ); pBufferCur += HTTP_EMPTY_PATH_LEN; } else { - ( void ) strncpy( pBufferCur, pPath, pathLen ); + ( void ) memcpy( pBufferCur, pPath, pathLen ); pBufferCur += pathLen; } *pBufferCur = SPACE_CHARACTER; pBufferCur += SPACE_CHARACTER_LEN; - ( void ) strncpy( pBufferCur, - HTTP_PROTOCOL_VERSION, - HTTP_PROTOCOL_VERSION_LEN ); + ( void ) memcpy( pBufferCur, + HTTP_PROTOCOL_VERSION, + HTTP_PROTOCOL_VERSION_LEN ); pBufferCur += HTTP_PROTOCOL_VERSION_LEN; ( void ) memcpy( pBufferCur,