Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add response buffer len check #125

Merged
merged 4 commits into from
Jan 7, 2022

Conversation

chinglee-iot
Copy link
Member

Add response buffer length check to prevent receive zero byte with transport interface in receiveAndParseHttpResponse.

static HTTPStatus_t receiveAndParseHttpResponse( const TransportInterface_t * pTransport,
                                                 HTTPResponse_t * pResponse,
                                                 const HTTPRequestHeaders_t * pRequestHeaders )
{
...
    while( shouldRecv == 1U )
    {
        /* Receive the HTTP response data into the pResponse->pBuffer. */
        currentReceived = pTransport->recv( pTransport->pNetworkContext,
                                            pResponse->pBuffer + totalReceived,
                                            pResponse->bufferLen - totalReceived );

@chinglee-iot chinglee-iot requested review from aggarg and ActoryOu and removed request for aggarg January 4, 2022 08:23
ActoryOu
ActoryOu previously approved these changes Jan 5, 2022
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
@aggarg aggarg merged commit 1f61846 into FreeRTOS:main Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants