Assert that Ethernet buffer has space for an ARP packet.
This avoids a buffer overflow in vARPGenerateRequestPacket.  Network
buffers always have room for an ARP packet.  In portable/BufferManagement,
Buffer Allocation 2 defines baMINIMAL_BUFFER_SIZE and Buffer
Allocaiton 1 sets all buffers to the same length, often at least 1500.
@@ -589,6 +589,12 @@ void vARPGenerateRequestPacket( NetworkBufferDescriptor_t * const pxNetworkBuffe
{
ARPPacket_t *pxARPPacket;
+ /* Buffer allocation ensures that buffers always have space
+ for an ARP packet. See buffer allocation implementations 1
+ and 2 under portable/BufferManagement. */
+ configASSERT( pxNetworkBuffer );
+ configASSERT( pxNetworkBuffer->xDataLength >= sizeof(ARPPacket_t) );
+
pxARPPacket = ( ARPPacket_t * ) pxNetworkBuffer->pucEthernetBuffer;
/* memcpy the const part of the header information into the correct
