Skip to content

Commit

Permalink
Fix buffer access issue in UT.
Browse files Browse the repository at this point in the history
  • Loading branch information
ActoryOu committed Oct 17, 2024
1 parent 341d974 commit 145eaac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/unit-test/FreeRTOS_IP/FreeRTOS_IP_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -2404,8 +2404,8 @@ void test_prvProcessEthernetPacket_IPv4FrameType_NeedARPResolution( void )
struct xNetworkInterface xInterface;
NetworkEndPoint_t xNetworkEndPoint = { 0 };

pxNetworkBuffer->xDataLength = ipconfigTCP_MSS;
pxNetworkBuffer->pucEthernetBuffer = ucEthernetBuffer;
pxNetworkBuffer->xDataLength = ipconfigTCP_MSS - ipIP_TYPE_OFFSET;
pxNetworkBuffer->pucEthernetBuffer = ucEthernetBuffer + ipIP_TYPE_OFFSET;
pxNetworkBuffer->pxInterface = &xInterface;
pxNetworkBuffer->pxEndPoint = &xNetworkEndPoint;

Expand Down Expand Up @@ -2442,8 +2442,8 @@ void test_prvProcessEthernetPacket_IPv6FrameType_NeedNDResolution( void )
struct xNetworkInterface xInterface;
NetworkEndPoint_t xNetworkEndPoint = { 0 };

pxNetworkBuffer->xDataLength = ipconfigTCP_MSS;
pxNetworkBuffer->pucEthernetBuffer = ucEthernetBuffer;
pxNetworkBuffer->xDataLength = ipconfigTCP_MSS - ipIP_TYPE_OFFSET;
pxNetworkBuffer->pucEthernetBuffer = ucEthernetBuffer + ipIP_TYPE_OFFSET;
pxNetworkBuffer->pxInterface = &xInterface;
pxNetworkBuffer->pxEndPoint = &xNetworkEndPoint;

Expand Down Expand Up @@ -2480,8 +2480,8 @@ void test_prvProcessEthernetPacket_IPv6FrameType_NeedNDResolution2( void )
struct xNetworkInterface xInterface;
NetworkEndPoint_t xNetworkEndPoint = { 0 };

pxNetworkBuffer->xDataLength = ipconfigTCP_MSS;
pxNetworkBuffer->pucEthernetBuffer = ucEthernetBuffer;
pxNetworkBuffer->xDataLength = ipconfigTCP_MSS - ipIP_TYPE_OFFSET;
pxNetworkBuffer->pucEthernetBuffer = ucEthernetBuffer + ipIP_TYPE_OFFSET;
pxNetworkBuffer->pxInterface = &xInterface;
pxNetworkBuffer->pxEndPoint = &xNetworkEndPoint;

Expand Down

0 comments on commit 145eaac

Please sign in to comment.