Actual code that caused crash looked like this:
If total packet size < 20, bytes will be negative, which will cause crash within CalculateIPChecksum. With packet size between 20 and 27, result will be positive and CalculateIPChecksum will actually calculate checksum for requested number of bytes, but invalid ICMP packet will be sent (with only part of the header).
Best regards,
Victor
Code Select
int bytes = request->packetSize - sizeof(IPHDR);
packet.m_icmpHdr.m_wChecksum = 0;
packet.m_icmpHdr.m_wChecksum = CalculateIPChecksum(&packet, bytes);
If total packet size < 20, bytes will be negative, which will cause crash within CalculateIPChecksum. With packet size between 20 and 27, result will be positive and CalculateIPChecksum will actually calculate checksum for requested number of bytes, but invalid ICMP packet will be sent (with only part of the header).
Best regards,
Victor
Fix will be included into next patch release.